diff --git a/CHANGELOG.md b/CHANGELOG.md index d94b6ef7d3657..b7d4d51eea6e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ for details on updating existing applications using v1.x.y or v2.x.y. - Added Data Lineage Config Management library. +### [Dataplex](/google/cloud/dataplex/README.md) + +- Added Business Glossary library. +- Added CMEK library. +- Added Data Products library. + ## v3.3.0 - 2026-03 ### New Libraries @@ -20,9 +26,9 @@ for details on updating existing applications using v1.x.y or v2.x.y. We are happy to announce the following GA libraries. Unless specifically noted, the APIs in these libraries are stable, and are ready for production use. -- [Gemini Enterprise for Customer Experience API](google/cloud/ces/README.md) -- [Cluster Director API](google/cloud/hypercomputecluster/README.md) -- [Vector Search API](google/cloud/vectorsearch/README.md) +- [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) 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 da2013bd6f893..6d5c6f86cef5a 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/generator/generator_config.textproto b/generator/generator_config.textproto index 228dad8503b98..966e0c6b7e236 100644 --- a/generator/generator_config.textproto +++ b/generator/generator_config.textproto @@ -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,6 +1979,13 @@ service { retryable_status_codes: ["kUnavailable"] } +service { + service_proto_path: "google/cloud/dataplex/v1/cmek.proto" + product_path: "google/cloud/dataplex/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + service { service_proto_path: "google/cloud/dataplex/v1/content.proto" product_path: "google/cloud/dataplex/v1" @@ -1979,6 +1993,13 @@ service { retryable_status_codes: ["kUnavailable"] } +service { + service_proto_path: "google/cloud/dataplex/v1/data_products.proto" + product_path: "google/cloud/dataplex/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + service { service_proto_path: "google/cloud/dataplex/v1/datascans.proto" product_path: "google/cloud/dataplex/v1" 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/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/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/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/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/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/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/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_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_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/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); +}