diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f513a7b4ca00..247037edd340c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ breaking changes in the upcoming 3.x release. This release is scheduled for ## v2.37.0 - TBD +We are happy to announce the following GA libraries. Unless specifically noted, +the APIs in these libraries are stable, and are ready for production use. + +- [Financial Services API](/google/cloud/financialservices/README.md) + **BREAKING CHANGES** Client library `resourcesettings` is being removed because the service has been turned down. diff --git a/README.md b/README.md index 74f6172d28e3e..a764372572dcb 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,9 @@ See each library's `README.md` file for more information about: - [Cloud Filestore API](google/cloud/filestore/README.md) [[quickstart]](google/cloud/filestore/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/filestore/latest) +- [Financial Services API](google/cloud/financialservices/README.md) + [[quickstart]](google/cloud/financialservices/quickstart/README.md) + [[reference]](https://cloud.google.com/cpp/docs/reference/financialservices/latest) - [Cloud Functions API](google/cloud/functions/README.md) [[quickstart]](google/cloud/functions/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/functions/latest) diff --git a/ci/abi-dumps/google_cloud_cpp_financialservices.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_financialservices.expected.abi.dump.gz new file mode 100644 index 0000000000000..8ff421fb93e10 Binary files /dev/null and b/ci/abi-dumps/google_cloud_cpp_financialservices.expected.abi.dump.gz differ diff --git a/ci/etc/expected_install_directories b/ci/etc/expected_install_directories index fa5ed4f07b9ba..5d212dbd2e829 100644 --- a/ci/etc/expected_install_directories +++ b/ci/etc/expected_install_directories @@ -753,6 +753,10 @@ ./include/google/cloud/filestore/v1 ./include/google/cloud/filestore/v1/internal ./include/google/cloud/filestore/v1/mocks +./include/google/cloud/financialservices +./include/google/cloud/financialservices/v1 +./include/google/cloud/financialservices/v1/internal +./include/google/cloud/financialservices/v1/mocks ./include/google/cloud/functions ./include/google/cloud/functions/mocks ./include/google/cloud/functions/v1 @@ -1382,6 +1386,8 @@ ./lib64/cmake/google_cloud_cpp_eventarc_mocks ./lib64/cmake/google_cloud_cpp_filestore ./lib64/cmake/google_cloud_cpp_filestore_mocks +./lib64/cmake/google_cloud_cpp_financialservices +./lib64/cmake/google_cloud_cpp_financialservices_mocks ./lib64/cmake/google_cloud_cpp_functions ./lib64/cmake/google_cloud_cpp_functions_mocks ./lib64/cmake/google_cloud_cpp_gkebackup diff --git a/cmake/GoogleCloudCppFeatures.cmake b/cmake/GoogleCloudCppFeatures.cmake index 7d51542f65a55..eafbfc6c2c5b4 100644 --- a/cmake/GoogleCloudCppFeatures.cmake +++ b/cmake/GoogleCloudCppFeatures.cmake @@ -99,6 +99,7 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES "essentialcontacts" "eventarc" "filestore" + "financialservices" "functions" "gkebackup" "gkeconnect" diff --git a/external/googleapis/protodeps/financialservices.deps b/external/googleapis/protodeps/financialservices.deps new file mode 100644 index 0000000000000..98062774348f3 --- /dev/null +++ b/external/googleapis/protodeps/financialservices.deps @@ -0,0 +1,10 @@ +@com_google_googleapis//google/api:annotations_proto +@com_google_googleapis//google/api:client_proto +@com_google_googleapis//google/api:field_behavior_proto +@com_google_googleapis//google/api:http_proto +@com_google_googleapis//google/api:launch_stage_proto +@com_google_googleapis//google/api:resource_proto +@com_google_googleapis//google/longrunning:operations_proto +@com_google_googleapis//google/rpc:status_proto +@com_google_googleapis//google/type:datetime_proto +@com_google_googleapis//google/type:interval_proto diff --git a/external/googleapis/protolists/financialservices.list b/external/googleapis/protolists/financialservices.list new file mode 100644 index 0000000000000..e4feb668f9ac4 --- /dev/null +++ b/external/googleapis/protolists/financialservices.list @@ -0,0 +1,10 @@ +@com_google_googleapis//google/cloud/financialservices/v1:backtest_result.proto +@com_google_googleapis//google/cloud/financialservices/v1:bigquery_destination.proto +@com_google_googleapis//google/cloud/financialservices/v1:dataset.proto +@com_google_googleapis//google/cloud/financialservices/v1:engine_config.proto +@com_google_googleapis//google/cloud/financialservices/v1:engine_version.proto +@com_google_googleapis//google/cloud/financialservices/v1:instance.proto +@com_google_googleapis//google/cloud/financialservices/v1:line_of_business.proto +@com_google_googleapis//google/cloud/financialservices/v1:model.proto +@com_google_googleapis//google/cloud/financialservices/v1:prediction_result.proto +@com_google_googleapis//google/cloud/financialservices/v1:service.proto diff --git a/external/googleapis/update_libraries.sh b/external/googleapis/update_libraries.sh index cc3de8c84b745..cfac88e11fd9c 100755 --- a/external/googleapis/update_libraries.sh +++ b/external/googleapis/update_libraries.sh @@ -144,6 +144,7 @@ declare -A -r LIBRARIES=( "@com_google_googleapis//google/cloud/eventarc/publishing/v1:publishing_cc_grpc" )" ["filestore"]="@com_google_googleapis//google/cloud/filestore/v1:filestore_cc_grpc" + ["financialservices"]="@com_google_googleapis//google/cloud/financialservices/v1:financialservices_cc_grpc" ["functions"]="$( printf ",%s" \ "@com_google_googleapis//google/cloud/functions/v1:functions_cc_grpc" \ diff --git a/generator/generator_config.textproto b/generator/generator_config.textproto index e259a794488c5..7e94d5dce7c16 100644 --- a/generator/generator_config.textproto +++ b/generator/generator_config.textproto @@ -2478,6 +2478,13 @@ service { retryable_status_codes: ["kUnavailable"] } +service { + service_proto_path: "google/cloud/financialservices/v1/service.proto" + product_path: "google/cloud/financialservices/v1" + initial_copyright_year: "2025" + retryable_status_codes: ["kUnavailable"] +} + # Functions service { service_proto_path: "google/cloud/functions/v1/functions.proto" diff --git a/google/cloud/financialservices/BUILD.bazel b/google/cloud/financialservices/BUILD.bazel new file mode 100644 index 0000000000000..48abe87cc2b9e --- /dev/null +++ b/google/cloud/financialservices/BUILD.bazel @@ -0,0 +1,31 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//bazel:gapic.bzl", "cc_gapic_library") + +package(default_visibility = ["//visibility:private"]) + +licenses(["notice"]) # Apache 2.0 + +service_dirs = ["v1/"] + +googleapis_deps = [ + "@com_google_googleapis//google/cloud/financialservices/v1:financialservices_cc_grpc", +] + +cc_gapic_library( + name = "financialservices", + googleapis_deps = googleapis_deps, + service_dirs = service_dirs, +) diff --git a/google/cloud/financialservices/CMakeLists.txt b/google/cloud/financialservices/CMakeLists.txt new file mode 100644 index 0000000000000..ef851ffe71a6d --- /dev/null +++ b/google/cloud/financialservices/CMakeLists.txt @@ -0,0 +1,35 @@ +# ~~~ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ~~~ + +include(GoogleCloudCppLibrary) + +google_cloud_cpp_add_gapic_library(financialservices "Financial Services API" + SERVICE_DIRS "v1/") + +if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) + add_executable(financialservices_quickstart "quickstart/quickstart.cc") + target_link_libraries(financialservices_quickstart + PRIVATE google-cloud-cpp::financialservices) + google_cloud_cpp_add_common_options(financialservices_quickstart) + add_test( + NAME financialservices_quickstart + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_REGION) + set_tests_properties(financialservices_quickstart + PROPERTIES LABELS "integration-test;quickstart") +endif () diff --git a/google/cloud/financialservices/README.md b/google/cloud/financialservices/README.md new file mode 100644 index 0000000000000..87a9105729e68 --- /dev/null +++ b/google/cloud/financialservices/README.md @@ -0,0 +1,62 @@ +# Financial Services API C++ Client Library + +This directory contains an idiomatic C++ client library for the +[Financial Services API][cloud-service-docs]. + +\ + +While this library is **GA**, please note that the Google Cloud C++ client +libraries do **not** follow [Semantic Versioning](https://semver.org/). + +## Quickstart + +The [quickstart/](quickstart/README.md) directory contains a minimal environment +to get started using this client library in a larger project. The following +"Hello World" program is used in this quickstart, and should give you a taste of +this library. + + + +```cc +#include "google/cloud/financialservices/v1/aml_client.h" +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/location.h" +#include + +int main(int argc, char* argv[]) try { + if (argc != 3) { + std::cerr << "Usage: " << argv[0] << " project-id location-id\n"; + return 1; + } + + auto const location = google::cloud::Location(argv[1], argv[2]); + + namespace financialservices = ::google::cloud::financialservices_v1; + auto client = + financialservices::AMLClient(financialservices::MakeAMLConnection()); + + for (auto r : client.ListInstances(location.FullName())) { + if (!r) throw std::move(r).status(); + std::cout << r->DebugString() << "\n"; + } + + return 0; +} catch (google::cloud::Status const& status) { + std::cerr << "google::cloud::Status thrown: " << status << "\n"; + return 1; +} +``` + + + +## More Information + +- Official documentation about the [Financial Services API][cloud-service-docs] + service +- [Reference doxygen documentation][doxygen-link] for each release of this + client library +- Detailed header comments in our [public `.h`][source-link] files + +[cloud-service-docs]: https://cloud.google.com/financial-services/anti-money-laundering/docs/concepts/overview +[doxygen-link]: https://cloud.google.com/cpp/docs/reference/financialservices/latest/ +[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/financialservices diff --git a/google/cloud/financialservices/doc/environment-variables.dox b/google/cloud/financialservices/doc/environment-variables.dox new file mode 100644 index 0000000000000..4ae2e8f6242f9 --- /dev/null +++ b/google/cloud/financialservices/doc/environment-variables.dox @@ -0,0 +1,50 @@ +/*! + +@page financialservices-env Environment Variables + +A number of environment variables can be used to configure the behavior of +the library. There are also functions to configure this behavior in code. The +environment variables are convenient when troubleshooting problems. + +@section financialservices-env-endpoint Endpoint Overrides + + + +- `GOOGLE_CLOUD_CPP_AML_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "financialservices.googleapis.com") + used by `MakeAMLConnection()`. + + + +@see google::cloud::EndpointOption + +@section financialservices-env-logging Logging + +`GOOGLE_CLOUD_CPP_ENABLE_TRACING=rpc`: turns on tracing for most gRPC +calls. The library injects an additional Stub decorator that prints each gRPC +request and response. Unless you have configured your own logging backend, +you should also set `GOOGLE_CLOUD_CPP_ENABLE_CLOG` to produce any output on +the program's console. + +@see google::cloud::LoggingComponentsOption + +`GOOGLE_CLOUD_CPP_TRACING_OPTIONS=...`: modifies the behavior of gRPC tracing, +including whether messages will be output on multiple lines, or whether +string/bytes fields will be truncated. + +@see google::cloud::GrpcTracingOptionsOption + +`GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes`: turns on logging in the library, basically +the library always "logs" but the logging infrastructure has no backend to +actually print anything until the application sets a backend or they set this +environment variable. + +@see google::cloud::LogBackend +@see google::cloud::LogSink + +@section financialservices-env-project Setting the Default Project + +`GOOGLE_CLOUD_PROJECT=...`: is used in examples and integration tests to +configure the GCP project. This has no effect in the library. + +*/ diff --git a/google/cloud/financialservices/doc/main.dox b/google/cloud/financialservices/doc/main.dox new file mode 100644 index 0000000000000..8974a65efa614 --- /dev/null +++ b/google/cloud/financialservices/doc/main.dox @@ -0,0 +1,47 @@ +/*! + +@mainpage Financial Services API C++ Client Library + +An idiomatic C++ client library for the [Financial Services API][cloud-service-docs]. + + + +While this library is **GA**, please note that the Google Cloud C++ client libraries do **not** follow +[Semantic Versioning](https://semver.org/). + +@tableofcontents{HTML:2} + +## Quickstart + +The following shows the code that you'll run in the +`google/cloud/financialservices/quickstart/` directory, +which should give you a taste of the Financial Services API C++ client library API. + +@snippet quickstart.cc all + +## Main classes + + +The main class in this library is +[`financialservices_v1::AMLClient`](@ref google::cloud::financialservices_v1::AMLClient). All RPCs are exposed +as member functions of this class. Other classes provide helpers, configuration +parameters, and infrastructure to mock +[`financialservices_v1::AMLClient`](@ref google::cloud::financialservices_v1::AMLClient) when testing your +application. + + +## More Information + +- @ref common-error-handling - describes how the library reports errors. +- @ref financialservices-override-endpoint - describes how to override the default + endpoint. +- @ref financialservices-override-authentication - describes how to change the + authentication credentials used by the library. +- @ref financialservices-override-retry - describes how to change the default retry + policies. +- @ref financialservices-env - describes environment variables that can configure the + behavior of the library. + +[cloud-service-docs]: https://cloud.google.com/financial-services/anti-money-laundering/docs/concepts/overview + +*/ diff --git a/google/cloud/financialservices/doc/options.dox b/google/cloud/financialservices/doc/options.dox new file mode 100644 index 0000000000000..7adf8a2e9bbdb --- /dev/null +++ b/google/cloud/financialservices/doc/options.dox @@ -0,0 +1,10 @@ +/*! +@defgroup google-cloud-financialservices-options Financial Services API Configuration Options + +This library uses the same mechanism (`google::cloud::Options`) and the common +[options](@ref options) as all other C++ client libraries for its configuration. +Some `*Option` classes, which are only used in this library, are documented in +this page. + +@see @ref options - for an overview of client library configuration. +*/ diff --git a/google/cloud/financialservices/doc/override-authentication.dox b/google/cloud/financialservices/doc/override-authentication.dox new file mode 100644 index 0000000000000..ef9e5ea1e2048 --- /dev/null +++ b/google/cloud/financialservices/doc/override-authentication.dox @@ -0,0 +1,35 @@ +/*! +@page financialservices-override-authentication How to Override the Authentication Credentials + +Unless otherwise configured, the client libraries use +[Application Default Credentials] to authenticate with Google Cloud Services. +While this works for most applications, in some cases you may need to override +this default. You can do so by providing the +[UnifiedCredentialsOption](@ref google::cloud::UnifiedCredentialsOption) +The following example shows how to explicitly load a service account key file: + + +@snippet aml_client_samples.cc with-service-account + + + +Keep in mind that we chose this as an example because it is relatively easy to +understand. Consult the [Best practices for managing service account keys] +guide for more details. + +@see @ref guac - for more information on the factory functions to create +`google::cloud::Credentials` objects. + +[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys +[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc + +*/ + +// + +/*! @page financialservices_v1::AMLClient-service-account-snippet Override financialservices_v1::AMLClient Authentication Defaults + +@snippet google/cloud/financialservices/v1/samples/aml_client_samples.cc with-service-account + +*/ +// diff --git a/google/cloud/financialservices/doc/override-endpoint.dox b/google/cloud/financialservices/doc/override-endpoint.dox new file mode 100644 index 0000000000000..7fcdef79a2428 --- /dev/null +++ b/google/cloud/financialservices/doc/override-endpoint.dox @@ -0,0 +1,25 @@ +/*! +@page financialservices-override-endpoint How to Override the Default Endpoint + +In some cases, you may need to override the default endpoint used by the client +library. Use the +[EndpointOption](@ref google::cloud::EndpointOption) when initializing the +client library to change this default. + + +For example, this will override the default endpoint for `financialservices_v1::AMLClient`: + +@snippet aml_client_samples.cc set-client-endpoint + + + +*/ + +// + +/*! @page financialservices_v1::AMLClient-endpoint-snippet Override financialservices_v1::AMLClient Endpoint Configuration + +@snippet google/cloud/financialservices/v1/samples/aml_client_samples.cc set-client-endpoint + +*/ +// diff --git a/google/cloud/financialservices/doc/override-retry-policies.dox b/google/cloud/financialservices/doc/override-retry-policies.dox new file mode 100644 index 0000000000000..40aaf38873f76 --- /dev/null +++ b/google/cloud/financialservices/doc/override-retry-policies.dox @@ -0,0 +1,108 @@ +/*! +@page financialservices-override-retry Override Retry, Backoff, and Idempotency Policies + +When it is safe to do so, the library automatically retries requests that fail +due to a transient error. The library then uses [exponential backoff] to backoff +before trying again. Which operations are considered safe to retry, which +errors are treated as transient failures, the details of the exponential backoff +algorithm, and for how long the library retries are all configurable via +policies. + +This document provides examples showing how to override the default policies. + +The policies can be set when the `*Connection` object is created. The library +provides default policies for any policy that is not set. The application can +also override some (or all) policies when the `*Client` object is created. This +can be useful if multiple `*Client` objects share the same `*Connection` object, +but you want different retry behavior in some of the clients. Finally, the +application can override some retry policies when calling a specific member +function. + +The library uses three different options to control the retry loop. The options +have per-client names. + +@section financialservices-override-retry-retry-policy Configuring the transient errors and retry duration + +The `*RetryPolicyOption` controls: + +- Which errors are to be treated as transient errors. +- How long the library will keep retrying transient errors. + +You can provide your own class for this option. The library also provides two +built-in policies: + +- `*LimitedErrorCountRetryPolicy`: stops retrying after a specified number + of transient errors. +- `*LimitedTimeRetryPolicy`: stops retrying after a specified time. + +Note that a library may have more than one version of these classes. Their name +match the `*Client` and `*Connection` object they are intended to be used +with. Some `*Client` objects treat different error codes as transient errors. +In most cases, only [kUnavailable](@ref google::cloud::StatusCode) is treated +as a transient error. + +@section financialservices-override-retry-backoff-policy Controlling the backoff algorithm + +The `*BackoffPolicyOption` controls how long the client library will wait +before retrying a request that failed with a transient error. You can provide +your own class for this option. + +The only built-in backoff policy is +[`ExponentialBackoffPolicy`](@ref google::cloud::ExponentialBackoffPolicy). +This class implements a truncated exponential backoff algorithm, with jitter. +In summary, it doubles the current backoff time after each failure. The actual +backoff time for an RPC is chosen at random, but never exceeds the current +backoff. The current backoff is doubled after each failure, but never exceeds +(or is "truncated") if it reaches a prescribed maximum. + +@section financialservices-override-retry-idempotency-policy Controlling which operations are retryable + +The `*IdempotencyPolicyOption` controls which requests are retryable, as some +requests are never safe to retry. + +Only one built-in idempotency policy is provided by the library. The name +matches the name of the client it is intended for. For example, `FooBarClient` +will use `FooBarIdempotencyPolicy`. This policy is very conservative. + +@section financialservices-override-retry-example Example + + +For example, this will override the retry policies for `financialservices_v1::AMLClient`: + +@snippet aml_client_samples.cc set-retry-policy + +This assumes you have created a custom idempotency policy. Such as: + +@snippet aml_client_samples.cc custom-idempotency-policy + +This will override the polling policies for `financialservices_v1::AMLClient` + +@snippet aml_client_samples.cc set-polling-policy + + + + +@section financialservices-override-retry-more-information More Information + +@see google::cloud::Options +@see google::cloud::BackoffPolicy +@see google::cloud::ExponentialBackoffPolicy + +[exponential backoff]: https://en.wikipedia.org/wiki/Exponential_backoff + +*/ + +// + +/*! @page financialservices_v1::AMLClient-retry-snippet Override financialservices_v1::AMLClient Retry Policies + +This shows how to override the retry policies for financialservices_v1::AMLClient: + +@snippet google/cloud/financialservices/v1/samples/aml_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/financialservices/v1/samples/aml_client_samples.cc custom-idempotency-policy + +*/ +// diff --git a/google/cloud/financialservices/quickstart/.bazelrc b/google/cloud/financialservices/quickstart/.bazelrc new file mode 100644 index 0000000000000..8431873b6fcba --- /dev/null +++ b/google/cloud/financialservices/quickstart/.bazelrc @@ -0,0 +1,30 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Use host-OS-specific config lines from bazelrc files. +build --enable_platform_specific_config=true + +# The project requires C++ >= 14. By default Bazel adds `-std=c++0x` which +# disables C++14 features, even if the compilers defaults to C++ >= 14 +build:linux --cxxopt=-std=c++14 +build:macos --cxxopt=-std=c++14 +# Protobuf and gRPC require (or soon will require) C++14 to compile the "host" +# targets, such as protoc and the grpc plugin. +build:linux --host_cxxopt=-std=c++14 +build:macos --host_cxxopt=-std=c++14 + +# Do not create the convenience links. They are inconvenient when the build +# runs inside a docker image or if one builds a quickstart and then builds +# the project separately. +build --experimental_convenience_symlinks=ignore diff --git a/google/cloud/financialservices/quickstart/BUILD.bazel b/google/cloud/financialservices/quickstart/BUILD.bazel new file mode 100644 index 0000000000000..c20b953ebbb80 --- /dev/null +++ b/google/cloud/financialservices/quickstart/BUILD.bazel @@ -0,0 +1,25 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache 2.0 + +cc_binary( + name = "quickstart", + srcs = [ + "quickstart.cc", + ], + deps = [ + "@google_cloud_cpp//:financialservices", + ], +) diff --git a/google/cloud/financialservices/quickstart/CMakeLists.txt b/google/cloud/financialservices/quickstart/CMakeLists.txt new file mode 100644 index 0000000000000..496cd651e6717 --- /dev/null +++ b/google/cloud/financialservices/quickstart/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# This file shows how to use the Financial Services API C++ client library from +# a larger CMake project. + +cmake_minimum_required(VERSION 3.10...3.24) +project(google-cloud-cpp-financialservices-quickstart CXX) + +find_package(google_cloud_cpp_financialservices REQUIRED) + +# MSVC requires some additional code to select the correct runtime library +if (VCPKG_TARGET_TRIPLET MATCHES "-static$") + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +else () + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") +endif () + +# Define your targets. +add_executable(quickstart quickstart.cc) +target_link_libraries(quickstart google-cloud-cpp::financialservices) diff --git a/google/cloud/financialservices/quickstart/MODULE.bazel b/google/cloud/financialservices/quickstart/MODULE.bazel new file mode 100644 index 0000000000000..00bb18361f7f6 --- /dev/null +++ b/google/cloud/financialservices/quickstart/MODULE.bazel @@ -0,0 +1,6 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### diff --git a/google/cloud/financialservices/quickstart/Makefile b/google/cloud/financialservices/quickstart/Makefile new file mode 100644 index 0000000000000..c3c8d92839ca3 --- /dev/null +++ b/google/cloud/financialservices/quickstart/Makefile @@ -0,0 +1,35 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This is a minimal Makefile to show how to use the Financial Services API C++ client +# for developers who use make(1) as their build system. + +# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for +# our tests, but applications would typically make them configurable parameters. +CXX=g++ +CXXFLAGS= +CXXLD=$(CXX) +BIN=. + +all: $(BIN)/quickstart + +# Configuration variables to compile and link against the Financial Services API C++ +# client library. +CLIENT_MODULE := google_cloud_cpp_financialservices +CLIENT_CXXFLAGS := $(shell pkg-config $(CLIENT_MODULE) --cflags) +CLIENT_CXXLDFLAGS := $(shell pkg-config $(CLIENT_MODULE) --libs-only-L) +CLIENT_LIBS := $(shell pkg-config $(CLIENT_MODULE) --libs-only-l) + +$(BIN)/quickstart: quickstart.cc + $(CXXLD) $(CXXFLAGS) $(CLIENT_CXXFLAGS) $(CLIENT_CXXLDFLAGS) -o $@ $^ $(CLIENT_LIBS) diff --git a/google/cloud/financialservices/quickstart/README.md b/google/cloud/financialservices/quickstart/README.md new file mode 100644 index 0000000000000..bf2a3aafb71b4 --- /dev/null +++ b/google/cloud/financialservices/quickstart/README.md @@ -0,0 +1,135 @@ +# HOWTO: using the Financial Services API C++ client in your project + +This directory contains small examples showing how to use the Financial Services +API C++ client library in your own project. These instructions assume that you +have some experience as a C++ developer and that you have a working C++ +toolchain (compiler, linker, etc.) installed on your platform. + +- Packaging maintainers or developers who prefer to install the library in a + fixed directory (such as `/usr/local` or `/opt`) should consult the + [packaging guide](/doc/packaging.md). +- Developers who prefer using a package manager such as + [vcpkg](https://vcpkg.io), or [Conda](https://conda.io), should follow the + instructions for their package manager. +- Developers wanting to use the libraries as part of a larger CMake or Bazel + project should consult the current document. Note that there are similar + documents for each library in their corresponding directories. +- Developers wanting to compile the library just to run some examples or tests + should consult the + [building and installing](/README.md#building-and-installing) section of the + top-level README file. +- Contributors and developers to `google-cloud-cpp` should consult the guide to + [set up a development workstation][howto-setup-dev-workstation]. + +## Before you begin + +To run the quickstart examples you will need a working Google Cloud Platform +(GCP) project. + +## Configuring authentication for the C++ Client Library + +Like most Google Cloud Platform (GCP) services, Financial Services API requires +that your application authenticates with the service before accessing any data. +If you are not familiar with GCP authentication please take this opportunity to +review the [Authentication methods at Google][authentication-quickstart]. + +## Using with Bazel + +> :warning: If you are using Windows or macOS there are additional instructions +> at the end of this document. + +1. Install Bazel using [the instructions][bazel-install] from the `bazel.build` + website. + +1. Compile this example using Bazel: + + ```bash + cd $HOME/google-cloud-cpp/google/cloud/financialservices/quickstart + bazel build ... + ``` + + Note that Bazel automatically downloads and compiles all dependencies of the + project. As it is often the case with C++ libraries, compiling these + dependencies may take several minutes. + +1. Run the example, changing the placeholder(s) to appropriate values: + + ```bash + bazel run :quickstart -- [...] + ``` + +## Using with CMake + +> :warning: If you are using Windows or macOS there are additional instructions +> at the end of this document. + +1. Install CMake. The package managers for most Linux distributions include a + package for CMake. Likewise, you can install CMake on Windows using a package + manager such as [chocolatey][choco-cmake-link], and on macOS using + [homebrew][homebrew-cmake-link]. You can also obtain the software directly + from the [cmake.org](https://cmake.org/download/). + +1. Install the dependencies with your favorite tools. As an example, if you use + [vcpkg](https://github.com/Microsoft/vcpkg.git): + + ```bash + cd $HOME/vcpkg + ./vcpkg install google-cloud-cpp[core,financialservices] + ``` + + Note that, as it is often the case with C++ libraries, compiling these + dependencies may take several minutes. + +1. Configure CMake, if necessary, configure the directory where you installed + the dependencies: + + ```bash + cd $HOME/google-cloud-cpp/google/cloud/financialservices/quickstart + cmake -S . -B .build -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake --build .build + ``` + +1. Run the example, changing the placeholder(s) to appropriate values: + + ```bash + .build/quickstart [...] + ``` + +## Platform Specific Notes + +### macOS + +gRPC [requires][grpc-roots-pem-bug] an environment variable to configure the +trust store for SSL certificates, you can download and configure this using: + +```bash +curl -Lo roots.pem https://pki.google.com/roots.pem +export GRPC_DEFAULT_SSL_ROOTS_FILE_PATH="$PWD/roots.pem" +``` + +### Windows + +Bazel tends to create very long file names and paths. You may need to use a +short directory to store the build output, such as `c:\b`, and instruct Bazel to +use it via: + +```shell +bazel --output_user_root=c:\b build ... +``` + +gRPC [requires][grpc-roots-pem-bug] an environment variable to configure the +trust store for SSL certificates, you can download and configure this using: + +```console +@powershell -NoProfile -ExecutionPolicy unrestricted -Command ^ + (new-object System.Net.WebClient).Downloadfile( ^ + 'https://pki.google.com/roots.pem', 'roots.pem') +set GRPC_DEFAULT_SSL_ROOTS_FILE_PATH=%cd%\roots.pem +``` + +[authentication-quickstart]: https://cloud.google.com/docs/authentication/client-libraries "Authenticate for using client libraries" +[bazel-install]: https://docs.bazel.build/versions/main/install.html +[choco-cmake-link]: https://chocolatey.org/packages/cmake +[grpc-roots-pem-bug]: https://github.com/grpc/grpc/issues/16571 +[homebrew-cmake-link]: https://formulae.brew.sh/formula/cmake +[howto-setup-dev-workstation]: /doc/contributor/howto-guide-setup-development-workstation.md diff --git a/google/cloud/financialservices/quickstart/WORKSPACE.bazel b/google/cloud/financialservices/quickstart/WORKSPACE.bazel new file mode 100644 index 0000000000000..af41a9581fdf7 --- /dev/null +++ b/google/cloud/financialservices/quickstart/WORKSPACE.bazel @@ -0,0 +1,53 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A minimal WORKSPACE file showing how to use the Financial Services API +# C++ client library in Bazel-based projects. +workspace(name = "qs") + +# Add the necessary Starlark functions to fetch google-cloud-cpp. +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +# Fetch the Google Cloud C++ libraries. +# NOTE: Update this version and SHA256 as needed. +http_archive( + name = "google_cloud_cpp", + sha256 = "9a6e182fd658ba114512cf21bd9f274a315830638f62f0b831113df9e674bea0", + strip_prefix = "google-cloud-cpp-2.36.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v2.36.0.tar.gz", +) + +load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") + +gl_cpp_workspace0() + +load("@google_cloud_cpp//bazel:workspace1.bzl", "gl_cpp_workspace1") + +gl_cpp_workspace1() + +load("@google_cloud_cpp//bazel:workspace2.bzl", "gl_cpp_workspace2") + +gl_cpp_workspace2() + +load("@google_cloud_cpp//bazel:workspace3.bzl", "gl_cpp_workspace3") + +gl_cpp_workspace3() + +load("@google_cloud_cpp//bazel:workspace4.bzl", "gl_cpp_workspace4") + +gl_cpp_workspace4() + +load("@google_cloud_cpp//bazel:workspace5.bzl", "gl_cpp_workspace5") + +gl_cpp_workspace5() diff --git a/google/cloud/financialservices/quickstart/quickstart.cc b/google/cloud/financialservices/quickstart/quickstart.cc new file mode 100644 index 0000000000000..611892675d89b --- /dev/null +++ b/google/cloud/financialservices/quickstart/quickstart.cc @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! [all] +#include "google/cloud/financialservices/v1/aml_client.h" +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/location.h" +#include + +int main(int argc, char* argv[]) try { + if (argc != 3) { + std::cerr << "Usage: " << argv[0] << " project-id location-id\n"; + return 1; + } + + auto const location = google::cloud::Location(argv[1], argv[2]); + + namespace financialservices = ::google::cloud::financialservices_v1; + auto client = + financialservices::AMLClient(financialservices::MakeAMLConnection()); + + for (auto r : client.ListInstances(location.FullName())) { + if (!r) throw std::move(r).status(); + std::cout << r->DebugString() << "\n"; + } + + return 0; +} catch (google::cloud::Status const& status) { + std::cerr << "google::cloud::Status thrown: " << status << "\n"; + return 1; +} +//! [all] diff --git a/google/cloud/financialservices/v1/.repo-metadata.json b/google/cloud/financialservices/v1/.repo-metadata.json new file mode 100644 index 0000000000000..a3bec87ba1b27 --- /dev/null +++ b/google/cloud/financialservices/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "financialservices.googleapis.com", + "api_shortname": "financialservices", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/financialservices/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:933093%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Financial Services API", + "product_documentation": "https://cloud.google.com/financial-services/anti-money-laundering/docs/concepts/overview", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/financialservices/v1/aml_client.cc b/google/cloud/financialservices/v1/aml_client.cc new file mode 100644 index 0000000000000..6c8d69e795cf0 --- /dev/null +++ b/google/cloud/financialservices/v1/aml_client.cc @@ -0,0 +1,1481 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/aml_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AMLClient::AMLClient(std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +AMLClient::~AMLClient() = default; + +StreamRange +AMLClient::ListInstances(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ListInstancesRequest request; + request.set_parent(parent); + return connection_->ListInstances(request); +} + +StreamRange +AMLClient::ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListInstances(std::move(request)); +} + +StatusOr AMLClient::GetInstance( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::GetInstanceRequest request; + request.set_name(name); + return connection_->GetInstance(request); +} + +StatusOr AMLClient::GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetInstance(request); +} + +future> +AMLClient::CreateInstance( + std::string const& parent, + google::cloud::financialservices::v1::Instance const& instance, + std::string const& instance_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateInstanceRequest request; + request.set_parent(parent); + *request.mutable_instance() = instance; + request.set_instance_id(instance_id); + return connection_->CreateInstance(request); +} + +StatusOr AMLClient::CreateInstance( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::Instance const& instance, + std::string const& instance_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateInstanceRequest request; + request.set_parent(parent); + *request.mutable_instance() = instance; + request.set_instance_id(instance_id); + return connection_->CreateInstance(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateInstance(request); +} + +StatusOr AMLClient::CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateInstance(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateInstance(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateInstance(operation); +} + +future> +AMLClient::UpdateInstance( + google::cloud::financialservices::v1::Instance const& instance, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateInstanceRequest request; + *request.mutable_instance() = instance; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateInstance(request); +} + +StatusOr AMLClient::UpdateInstance( + NoAwaitTag, google::cloud::financialservices::v1::Instance const& instance, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateInstanceRequest request; + *request.mutable_instance() = instance; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateInstance(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateInstance(request); +} + +StatusOr AMLClient::UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateInstance(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateInstance(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateInstance(operation); +} + +future> +AMLClient::DeleteInstance(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteInstanceRequest request; + request.set_name(name); + return connection_->DeleteInstance(request); +} + +StatusOr AMLClient::DeleteInstance( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteInstanceRequest request; + request.set_name(name); + return connection_->DeleteInstance(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteInstance(request); +} + +StatusOr AMLClient::DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteInstance(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteInstance(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteInstance(operation); +} + +future> +AMLClient::ImportRegisteredParties( + std::string const& name, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest:: + UpdateMode mode, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + std::vector const& party_tables, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest request; + request.set_name(name); + request.set_mode(mode); + request.set_line_of_business(line_of_business); + *request.mutable_party_tables() = {party_tables.begin(), party_tables.end()}; + return connection_->ImportRegisteredParties(request); +} + +StatusOr AMLClient::ImportRegisteredParties( + NoAwaitTag, std::string const& name, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest:: + UpdateMode mode, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + std::vector const& party_tables, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest request; + request.set_name(name); + request.set_mode(mode); + request.set_line_of_business(line_of_business); + *request.mutable_party_tables() = {party_tables.begin(), party_tables.end()}; + return connection_->ImportRegisteredParties(NoAwaitTag{}, request); +} + +future> +AMLClient::ImportRegisteredParties( + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportRegisteredParties(request); +} + +StatusOr AMLClient::ImportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportRegisteredParties(NoAwaitTag{}, request); +} + +future> +AMLClient::ImportRegisteredParties( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportRegisteredParties(operation); +} + +future> +AMLClient::ExportRegisteredParties( + std::string const& name, + google::cloud::financialservices::v1::BigQueryDestination const& dataset, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest request; + request.set_name(name); + *request.mutable_dataset() = dataset; + request.set_line_of_business(line_of_business); + return connection_->ExportRegisteredParties(request); +} + +StatusOr AMLClient::ExportRegisteredParties( + NoAwaitTag, std::string const& name, + google::cloud::financialservices::v1::BigQueryDestination const& dataset, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest request; + request.set_name(name); + *request.mutable_dataset() = dataset; + request.set_line_of_business(line_of_business); + return connection_->ExportRegisteredParties(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportRegisteredParties( + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportRegisteredParties(request); +} + +StatusOr AMLClient::ExportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportRegisteredParties(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportRegisteredParties( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportRegisteredParties(operation); +} + +StreamRange +AMLClient::ListDatasets(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ListDatasetsRequest request; + request.set_parent(parent); + return connection_->ListDatasets(request); +} + +StreamRange +AMLClient::ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListDatasets(std::move(request)); +} + +StatusOr AMLClient::GetDataset( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::GetDatasetRequest request; + request.set_name(name); + return connection_->GetDataset(request); +} + +StatusOr AMLClient::GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetDataset(request); +} + +future> +AMLClient::CreateDataset( + std::string const& parent, + google::cloud::financialservices::v1::Dataset const& dataset, + std::string const& dataset_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateDatasetRequest request; + request.set_parent(parent); + *request.mutable_dataset() = dataset; + request.set_dataset_id(dataset_id); + return connection_->CreateDataset(request); +} + +StatusOr AMLClient::CreateDataset( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::Dataset const& dataset, + std::string const& dataset_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateDatasetRequest request; + request.set_parent(parent); + *request.mutable_dataset() = dataset; + request.set_dataset_id(dataset_id); + return connection_->CreateDataset(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataset(request); +} + +StatusOr AMLClient::CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataset(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateDataset(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataset(operation); +} + +future> +AMLClient::UpdateDataset( + google::cloud::financialservices::v1::Dataset const& dataset, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateDatasetRequest request; + *request.mutable_dataset() = dataset; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataset(request); +} + +StatusOr AMLClient::UpdateDataset( + NoAwaitTag, google::cloud::financialservices::v1::Dataset const& dataset, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateDatasetRequest request; + *request.mutable_dataset() = dataset; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataset(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataset(request); +} + +StatusOr AMLClient::UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataset(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateDataset(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataset(operation); +} + +future> +AMLClient::DeleteDataset(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteDatasetRequest request; + request.set_name(name); + return connection_->DeleteDataset(request); +} + +StatusOr AMLClient::DeleteDataset( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteDatasetRequest request; + request.set_name(name); + return connection_->DeleteDataset(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataset(request); +} + +StatusOr AMLClient::DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataset(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteDataset(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataset(operation); +} + +StreamRange AMLClient::ListModels( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ListModelsRequest request; + request.set_parent(parent); + return connection_->ListModels(request); +} + +StreamRange AMLClient::ListModels( + google::cloud::financialservices::v1::ListModelsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListModels(std::move(request)); +} + +StatusOr AMLClient::GetModel( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::GetModelRequest request; + request.set_name(name); + return connection_->GetModel(request); +} + +StatusOr AMLClient::GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetModel(request); +} + +future> +AMLClient::CreateModel(std::string const& parent, + google::cloud::financialservices::v1::Model const& model, + std::string const& model_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateModelRequest request; + request.set_parent(parent); + *request.mutable_model() = model; + request.set_model_id(model_id); + return connection_->CreateModel(request); +} + +StatusOr AMLClient::CreateModel( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::Model const& model, + std::string const& model_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateModelRequest request; + request.set_parent(parent); + *request.mutable_model() = model; + request.set_model_id(model_id); + return connection_->CreateModel(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateModel(request); +} + +StatusOr AMLClient::CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateModel(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateModel(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateModel(operation); +} + +future> +AMLClient::UpdateModel(google::cloud::financialservices::v1::Model const& model, + google::protobuf::FieldMask const& update_mask, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateModelRequest request; + *request.mutable_model() = model; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateModel(request); +} + +StatusOr AMLClient::UpdateModel( + NoAwaitTag, google::cloud::financialservices::v1::Model const& model, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateModelRequest request; + *request.mutable_model() = model; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateModel(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateModel(request); +} + +StatusOr AMLClient::UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateModel(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateModel(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateModel(operation); +} + +future< + StatusOr> +AMLClient::ExportModelMetadata( + std::string const& model, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportModelMetadataRequest request; + request.set_model(model); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportModelMetadata(request); +} + +StatusOr AMLClient::ExportModelMetadata( + NoAwaitTag, std::string const& model, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportModelMetadataRequest request; + request.set_model(model); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportModelMetadata(NoAwaitTag{}, request); +} + +future< + StatusOr> +AMLClient::ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportModelMetadata(request); +} + +StatusOr AMLClient::ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportModelMetadata(NoAwaitTag{}, request); +} + +future< + StatusOr> +AMLClient::ExportModelMetadata(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportModelMetadata(operation); +} + +future> +AMLClient::DeleteModel(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteModelRequest request; + request.set_name(name); + return connection_->DeleteModel(request); +} + +StatusOr AMLClient::DeleteModel( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteModelRequest request; + request.set_name(name); + return connection_->DeleteModel(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteModel(request); +} + +StatusOr AMLClient::DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteModel(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteModel(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteModel(operation); +} + +StreamRange +AMLClient::ListEngineConfigs(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ListEngineConfigsRequest request; + request.set_parent(parent); + return connection_->ListEngineConfigs(request); +} + +StreamRange +AMLClient::ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListEngineConfigs(std::move(request)); +} + +StatusOr +AMLClient::GetEngineConfig(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::GetEngineConfigRequest request; + request.set_name(name); + return connection_->GetEngineConfig(request); +} + +StatusOr +AMLClient::GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetEngineConfig(request); +} + +future> +AMLClient::CreateEngineConfig( + std::string const& parent, + google::cloud::financialservices::v1::EngineConfig const& engine_config, + std::string const& engine_config_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateEngineConfigRequest request; + request.set_parent(parent); + *request.mutable_engine_config() = engine_config; + request.set_engine_config_id(engine_config_id); + return connection_->CreateEngineConfig(request); +} + +StatusOr AMLClient::CreateEngineConfig( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::EngineConfig const& engine_config, + std::string const& engine_config_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateEngineConfigRequest request; + request.set_parent(parent); + *request.mutable_engine_config() = engine_config; + request.set_engine_config_id(engine_config_id); + return connection_->CreateEngineConfig(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEngineConfig(request); +} + +StatusOr AMLClient::CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEngineConfig(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateEngineConfig(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEngineConfig(operation); +} + +future> +AMLClient::UpdateEngineConfig( + google::cloud::financialservices::v1::EngineConfig const& engine_config, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateEngineConfigRequest request; + *request.mutable_engine_config() = engine_config; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEngineConfig(request); +} + +StatusOr AMLClient::UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::EngineConfig const& engine_config, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateEngineConfigRequest request; + *request.mutable_engine_config() = engine_config; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEngineConfig(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEngineConfig(request); +} + +StatusOr AMLClient::UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEngineConfig(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateEngineConfig(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEngineConfig(operation); +} + +future> +AMLClient::ExportEngineConfigMetadata( + std::string const& engine_config, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportEngineConfigMetadataRequest + request; + request.set_engine_config(engine_config); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportEngineConfigMetadata(request); +} + +StatusOr AMLClient::ExportEngineConfigMetadata( + NoAwaitTag, std::string const& engine_config, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportEngineConfigMetadataRequest + request; + request.set_engine_config(engine_config); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportEngineConfigMetadata(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportEngineConfigMetadata(request); +} + +StatusOr AMLClient::ExportEngineConfigMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportEngineConfigMetadata(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportEngineConfigMetadata( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportEngineConfigMetadata(operation); +} + +future> +AMLClient::DeleteEngineConfig(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteEngineConfigRequest request; + request.set_name(name); + return connection_->DeleteEngineConfig(request); +} + +StatusOr AMLClient::DeleteEngineConfig( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteEngineConfigRequest request; + request.set_name(name); + return connection_->DeleteEngineConfig(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEngineConfig(request); +} + +StatusOr AMLClient::DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEngineConfig(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteEngineConfig(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEngineConfig(operation); +} + +StatusOr +AMLClient::GetEngineVersion(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::GetEngineVersionRequest request; + request.set_name(name); + return connection_->GetEngineVersion(request); +} + +StatusOr +AMLClient::GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetEngineVersion(request); +} + +StreamRange +AMLClient::ListEngineVersions(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ListEngineVersionsRequest request; + request.set_parent(parent); + return connection_->ListEngineVersions(request); +} + +StreamRange +AMLClient::ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListEngineVersions(std::move(request)); +} + +StreamRange +AMLClient::ListPredictionResults(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ListPredictionResultsRequest request; + request.set_parent(parent); + return connection_->ListPredictionResults(request); +} + +StreamRange +AMLClient::ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListPredictionResults(std::move(request)); +} + +StatusOr +AMLClient::GetPredictionResult(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::GetPredictionResultRequest request; + request.set_name(name); + return connection_->GetPredictionResult(request); +} + +StatusOr +AMLClient::GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetPredictionResult(request); +} + +future> +AMLClient::CreatePredictionResult( + std::string const& parent, + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + std::string const& prediction_result_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreatePredictionResultRequest request; + request.set_parent(parent); + *request.mutable_prediction_result() = prediction_result; + request.set_prediction_result_id(prediction_result_id); + return connection_->CreatePredictionResult(request); +} + +StatusOr AMLClient::CreatePredictionResult( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + std::string const& prediction_result_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreatePredictionResultRequest request; + request.set_parent(parent); + *request.mutable_prediction_result() = prediction_result; + request.set_prediction_result_id(prediction_result_id); + return connection_->CreatePredictionResult(NoAwaitTag{}, request); +} + +future> +AMLClient::CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreatePredictionResult(request); +} + +StatusOr AMLClient::CreatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreatePredictionResult(NoAwaitTag{}, request); +} + +future> +AMLClient::CreatePredictionResult( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreatePredictionResult(operation); +} + +future> +AMLClient::UpdatePredictionResult( + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdatePredictionResultRequest request; + *request.mutable_prediction_result() = prediction_result; + *request.mutable_update_mask() = update_mask; + return connection_->UpdatePredictionResult(request); +} + +StatusOr AMLClient::UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdatePredictionResultRequest request; + *request.mutable_prediction_result() = prediction_result; + *request.mutable_update_mask() = update_mask; + return connection_->UpdatePredictionResult(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdatePredictionResult(request); +} + +StatusOr AMLClient::UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdatePredictionResult(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdatePredictionResult( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdatePredictionResult(operation); +} + +future> +AMLClient::ExportPredictionResultMetadata( + std::string const& prediction_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportPredictionResultMetadataRequest + request; + request.set_prediction_result(prediction_result); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportPredictionResultMetadata(request); +} + +StatusOr +AMLClient::ExportPredictionResultMetadata( + NoAwaitTag, std::string const& prediction_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportPredictionResultMetadataRequest + request; + request.set_prediction_result(prediction_result); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportPredictionResultMetadata(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportPredictionResultMetadata(request); +} + +StatusOr +AMLClient::ExportPredictionResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportPredictionResultMetadata(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportPredictionResultMetadata( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportPredictionResultMetadata(operation); +} + +future> +AMLClient::DeletePredictionResult(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeletePredictionResultRequest request; + request.set_name(name); + return connection_->DeletePredictionResult(request); +} + +StatusOr AMLClient::DeletePredictionResult( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeletePredictionResultRequest request; + request.set_name(name); + return connection_->DeletePredictionResult(NoAwaitTag{}, request); +} + +future> +AMLClient::DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeletePredictionResult(request); +} + +StatusOr AMLClient::DeletePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeletePredictionResult(NoAwaitTag{}, request); +} + +future> +AMLClient::DeletePredictionResult( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeletePredictionResult(operation); +} + +StreamRange +AMLClient::ListBacktestResults(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ListBacktestResultsRequest request; + request.set_parent(parent); + return connection_->ListBacktestResults(request); +} + +StreamRange +AMLClient::ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListBacktestResults(std::move(request)); +} + +StatusOr +AMLClient::GetBacktestResult(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::GetBacktestResultRequest request; + request.set_name(name); + return connection_->GetBacktestResult(request); +} + +StatusOr +AMLClient::GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetBacktestResult(request); +} + +future> +AMLClient::CreateBacktestResult( + std::string const& parent, + google::cloud::financialservices::v1::BacktestResult const& backtest_result, + std::string const& backtest_result_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateBacktestResultRequest request; + request.set_parent(parent); + *request.mutable_backtest_result() = backtest_result; + request.set_backtest_result_id(backtest_result_id); + return connection_->CreateBacktestResult(request); +} + +StatusOr AMLClient::CreateBacktestResult( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::BacktestResult const& backtest_result, + std::string const& backtest_result_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::CreateBacktestResultRequest request; + request.set_parent(parent); + *request.mutable_backtest_result() = backtest_result; + request.set_backtest_result_id(backtest_result_id); + return connection_->CreateBacktestResult(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateBacktestResult(request); +} + +StatusOr AMLClient::CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateBacktestResult(NoAwaitTag{}, request); +} + +future> +AMLClient::CreateBacktestResult(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateBacktestResult(operation); +} + +future> +AMLClient::UpdateBacktestResult( + google::cloud::financialservices::v1::BacktestResult const& backtest_result, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateBacktestResultRequest request; + *request.mutable_backtest_result() = backtest_result; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateBacktestResult(request); +} + +StatusOr AMLClient::UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::BacktestResult const& backtest_result, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::UpdateBacktestResultRequest request; + *request.mutable_backtest_result() = backtest_result; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateBacktestResult(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateBacktestResult(request); +} + +StatusOr AMLClient::UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateBacktestResult(NoAwaitTag{}, request); +} + +future> +AMLClient::UpdateBacktestResult(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateBacktestResult(operation); +} + +future> +AMLClient::ExportBacktestResultMetadata( + std::string const& backtest_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportBacktestResultMetadataRequest + request; + request.set_backtest_result(backtest_result); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportBacktestResultMetadata(request); +} + +StatusOr +AMLClient::ExportBacktestResultMetadata( + NoAwaitTag, std::string const& backtest_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::ExportBacktestResultMetadataRequest + request; + request.set_backtest_result(backtest_result); + *request.mutable_structured_metadata_destination() = + structured_metadata_destination; + return connection_->ExportBacktestResultMetadata(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportBacktestResultMetadata(request); +} + +StatusOr +AMLClient::ExportBacktestResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportBacktestResultMetadata(NoAwaitTag{}, request); +} + +future> +AMLClient::ExportBacktestResultMetadata( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportBacktestResultMetadata(operation); +} + +future> +AMLClient::DeleteBacktestResult(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteBacktestResultRequest request; + request.set_name(name); + return connection_->DeleteBacktestResult(request); +} + +StatusOr AMLClient::DeleteBacktestResult( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::financialservices::v1::DeleteBacktestResultRequest request; + request.set_name(name); + return connection_->DeleteBacktestResult(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteBacktestResult(request); +} + +StatusOr AMLClient::DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteBacktestResult(NoAwaitTag{}, request); +} + +future> +AMLClient::DeleteBacktestResult(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteBacktestResult(operation); +} + +StreamRange AMLClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr AMLClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange AMLClient::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 AMLClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr AMLClient::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 AMLClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status AMLClient::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 AMLClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status AMLClient::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 AMLClient::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 financialservices_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/aml_client.h b/google/cloud/financialservices/v1/aml_client.h new file mode 100644 index 0000000000000..06e149bb1d20f --- /dev/null +++ b/google/cloud/financialservices/v1/aml_client.h @@ -0,0 +1,4340 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CLIENT_H + +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/future.h" +#include "google/cloud/no_await_tag.h" +#include "google/cloud/options.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// The AML (Anti Money Laundering) service allows users to perform REST +/// operations on aml. +/// +/// @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 AMLClient { + public: + explicit AMLClient(std::shared_ptr connection, + Options opts = {}); + ~AMLClient(); + + ///@{ + /// @name Copy and move support + AMLClient(AMLClient const&) = default; + AMLClient& operator=(AMLClient const&) = default; + AMLClient(AMLClient&&) = default; + AMLClient& operator=(AMLClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(AMLClient const& a, AMLClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(AMLClient const& a, AMLClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists instances. + /// + /// @param parent Required. The parent of the Instance is the location for that Instance. + /// Every location has exactly one instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.Instance], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// [google.cloud.financialservices.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L90} + /// + // clang-format on + StreamRange ListInstances( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists instances. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ListInstancesRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.Instance], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// [google.cloud.financialservices.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L90} + /// + // clang-format on + StreamRange ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets an instance. + /// + /// @param name Required. The resource name of the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.Instance]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L132} + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// + // clang-format on + StatusOr GetInstance( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets an instance. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.GetInstanceRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.Instance]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L132} + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// + // clang-format on + StatusOr GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates an instance. + /// + /// @param parent Required. The parent of the Instance is the location for that Instance. + /// Every location has exactly one instance. + /// @param instance Required. The instance that will be created. + /// @param instance_id Required. The resource id of the instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Instance] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L143} + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// + // clang-format on + future> + CreateInstance(std::string const& parent, + google::cloud::financialservices::v1::Instance const& instance, + std::string const& instance_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateInstance + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateInstance( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::Instance const& instance, + std::string const& instance_id, Options opts = {}); + + // clang-format off + /// + /// Creates an instance. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.CreateInstanceRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Instance] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L143} + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// + // clang-format on + future> + CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateInstance + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateInstance + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + CreateInstance(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Instance. + /// + /// @param instance Required. The new value of the instance fields that will be updated + /// according to the update_mask + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Instance resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Instance] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// [google.cloud.financialservices.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L176} + /// + // clang-format on + future> + UpdateInstance(google::cloud::financialservices::v1::Instance const& instance, + google::protobuf::FieldMask const& update_mask, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateInstance + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::Instance const& instance, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Instance. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.UpdateInstanceRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Instance] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Instance]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L36} + /// [google.cloud.financialservices.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L176} + /// + // clang-format on + future> + UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateInstance + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateInstance + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + UpdateInstance(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes an instance. + /// + /// @param name Required. The resource name of the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L206} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteInstance(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteInstance + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteInstance( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes an instance. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.DeleteInstanceRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L206} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteInstance + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteInstance + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteInstance(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Imports the list of registered parties. See + /// [Create and manage + /// instances](https://cloud.google.com/financial-services/anti-money-laundering/docs/create-and-manage-instances#import-registered-parties) + /// for information on the input schema and response for this method. + /// + /// @param name Required. The full path to the Instance resource in this API. + /// format: "projects/{project}/locations/{location}/instances/{instance}" + /// @param mode Required. Mode of the request. + /// @param line_of_business Required. LineOfBusiness for the specified registered parties. + /// @param party_tables Optional. List of BigQuery tables. Union of tables will be taken if there + /// is more than one table. VPC-SC restrictions apply. format: + /// "bq://{project}.{bqDatasetID}.{bqTableID}" Use of `datasets` is preferred + /// over the latter due to its simplicity and the reduced risk of errors + /// `party_tables` and `datasets` must not be provided at the + /// same time + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ImportRegisteredPartiesResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ImportRegisteredPartiesRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L233} + /// [google.cloud.financialservices.v1.ImportRegisteredPartiesResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L275} + /// + // clang-format on + future> + ImportRegisteredParties( + std::string const& name, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest:: + UpdateMode mode, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + std::vector const& party_tables, Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportRegisteredParties + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ImportRegisteredParties( + NoAwaitTag, std::string const& name, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest:: + UpdateMode mode, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + std::vector const& party_tables, Options opts = {}); + + // clang-format off + /// + /// Imports the list of registered parties. See + /// [Create and manage + /// instances](https://cloud.google.com/financial-services/anti-money-laundering/docs/create-and-manage-instances#import-registered-parties) + /// for information on the input schema and response for this method. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ImportRegisteredPartiesRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ImportRegisteredPartiesResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ImportRegisteredPartiesRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L233} + /// [google.cloud.financialservices.v1.ImportRegisteredPartiesResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L275} + /// + // clang-format on + future> + ImportRegisteredParties(google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportRegisteredParties + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ImportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportRegisteredParties + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + ImportRegisteredParties(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Exports the list of registered parties. See + /// [Create and manage + /// instances](https://cloud.google.com/financial-services/anti-money-laundering/docs/create-and-manage-instances#export-registered-parties) + /// for information on the output schema for this method. + /// + /// @param name Required. The full path to the Instance resource in this API. + /// format: "projects/{project}/locations/{location}/instances/{instance}" + /// @param dataset Required. The location to output the RegisteredParties. + /// @param line_of_business Required. LineOfBusiness to get RegisteredParties from. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportRegisteredPartiesResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportRegisteredPartiesRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L299} + /// [google.cloud.financialservices.v1.ExportRegisteredPartiesResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L317} + /// + // clang-format on + future> + ExportRegisteredParties( + std::string const& name, + google::cloud::financialservices::v1::BigQueryDestination const& dataset, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportRegisteredParties + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportRegisteredParties( + NoAwaitTag, std::string const& name, + google::cloud::financialservices::v1::BigQueryDestination const& dataset, + google::cloud::financialservices::v1::LineOfBusiness line_of_business, + Options opts = {}); + + // clang-format off + /// + /// Exports the list of registered parties. See + /// [Create and manage + /// instances](https://cloud.google.com/financial-services/anti-money-laundering/docs/create-and-manage-instances#export-registered-parties) + /// for information on the output schema for this method. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ExportRegisteredPartiesRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportRegisteredPartiesResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportRegisteredPartiesRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L299} + /// [google.cloud.financialservices.v1.ExportRegisteredPartiesResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/instance.proto#L317} + /// + // clang-format on + future> + ExportRegisteredParties(google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportRegisteredParties + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportRegisteredParties + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + ExportRegisteredParties(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists datasets. + /// + /// @param parent Required. The parent of the Dataset is the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.Dataset], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// [google.cloud.financialservices.v1.ListDatasetsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L97} + /// + // clang-format on + StreamRange ListDatasets( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists datasets. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ListDatasetsRequest]. + /// Proto messages are converted to C++ 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.financialservices.v1.Dataset], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// [google.cloud.financialservices.v1.ListDatasetsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L97} + /// + // clang-format on + StreamRange ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets a dataset. + /// + /// @param name Required. The resource name of the Dataset + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.Dataset]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// [google.cloud.financialservices.v1.GetDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L138} + /// + // clang-format on + StatusOr GetDataset( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a dataset. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.GetDatasetRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.Dataset]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// [google.cloud.financialservices.v1.GetDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L138} + /// + // clang-format on + StatusOr GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a dataset. + /// + /// @param parent Required. The parent of the Dataset is the Instance. + /// @param dataset Required. The dataset that will be created. + /// @param dataset_id Required. The resource id of the dataset + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Dataset] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L149} + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// + // clang-format on + future> CreateDataset( + std::string const& parent, + google::cloud::financialservices::v1::Dataset const& dataset, + std::string const& dataset_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataset + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateDataset( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::Dataset const& dataset, + std::string const& dataset_id, Options opts = {}); + + // clang-format off + /// + /// Creates a dataset. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.CreateDatasetRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Dataset] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L149} + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// + // clang-format on + future> CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataset + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataset + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> CreateDataset( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Dataset. + /// + /// @param dataset Required. The new value of the dataset fields that will be updated + /// according to the update_mask. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Dataset resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Dataset] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// [google.cloud.financialservices.v1.UpdateDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L181} + /// + // clang-format on + future> UpdateDataset( + google::cloud::financialservices::v1::Dataset const& dataset, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataset + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateDataset( + NoAwaitTag, google::cloud::financialservices::v1::Dataset const& dataset, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Dataset. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.UpdateDatasetRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Dataset] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Dataset]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L32} + /// [google.cloud.financialservices.v1.UpdateDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L181} + /// + // clang-format on + future> UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataset + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataset + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> UpdateDataset( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a dataset. + /// + /// @param name Required. The resource name of the Dataset. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L211} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteDataset(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataset + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteDataset( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a dataset. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.DeleteDatasetRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteDatasetRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/dataset.proto#L211} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataset + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataset + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteDataset(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists models. + /// + /// @param parent Required. The parent of the Model is the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.Model], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ListModelsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L119} + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// + // clang-format on + StreamRange ListModels( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists models. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ListModelsRequest]. + /// Proto messages are converted to C++ 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.financialservices.v1.Model], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ListModelsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L119} + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// + // clang-format on + StreamRange ListModels( + google::cloud::financialservices::v1::ListModelsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets a model. + /// + /// @param name Required. The resource name of the Model + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.Model]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.GetModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L160} + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// + // clang-format on + StatusOr GetModel( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a model. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.GetModelRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.Model]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.GetModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L160} + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// + // clang-format on + StatusOr GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a model. + /// + /// @param parent Required. The parent of the Model is the Instance. + /// @param model Required. The Model that will be created. + /// @param model_id Required. The resource id of the Model + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Model] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L171} + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// + // clang-format on + future> CreateModel( + std::string const& parent, + google::cloud::financialservices::v1::Model const& model, + std::string const& model_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateModel + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateModel( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::Model const& model, + std::string const& model_id, Options opts = {}); + + // clang-format off + /// + /// Creates a model. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.CreateModelRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Model] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L171} + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// + // clang-format on + future> CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateModel + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateModel + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> CreateModel( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Model. + /// + /// @param model Required. The new value of the Model fields that will be updated according + /// to the update_mask. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Model resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Model] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// [google.cloud.financialservices.v1.UpdateModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L203} + /// + // clang-format on + future> UpdateModel( + google::cloud::financialservices::v1::Model const& model, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateModel + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateModel( + NoAwaitTag, google::cloud::financialservices::v1::Model const& model, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Model. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.UpdateModelRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.Model] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.Model]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L32} + /// [google.cloud.financialservices.v1.UpdateModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L203} + /// + // clang-format on + future> UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateModel + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateModel + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> UpdateModel( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Export governance information for a Model resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#model). + /// + /// @param model Required. The resource name of the Model. + /// @param structured_metadata_destination Required. BigQuery output where the metadata will be written. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportModelMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportModelMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L259} + /// [google.cloud.financialservices.v1.ExportModelMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L274} + /// + // clang-format on + future> + ExportModelMetadata( + std::string const& model, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportModelMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportModelMetadata( + NoAwaitTag, std::string const& model, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// Export governance information for a Model resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#model). + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ExportModelMetadataRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportModelMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportModelMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L259} + /// [google.cloud.financialservices.v1.ExportModelMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L274} + /// + // clang-format on + future> + ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportModelMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportModelMetadata + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + ExportModelMetadata(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a model. + /// + /// @param name Required. The resource name of the Model. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L233} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteModel(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteModel + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteModel(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes a model. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.DeleteModelRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteModelRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/model.proto#L233} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteModel + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteModel + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteModel(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists engine configs. + /// + /// @param parent Required. The parent of the EngineConfig is the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.EngineConfig], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// [google.cloud.financialservices.v1.ListEngineConfigsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L177} + /// + // clang-format on + StreamRange + ListEngineConfigs(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists engine configs. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ListEngineConfigsRequest]. + /// Proto messages are converted to C++ 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.financialservices.v1.EngineConfig], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// [google.cloud.financialservices.v1.ListEngineConfigsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L177} + /// + // clang-format on + StreamRange + ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets an engine config. + /// + /// @param name Required. The resource name of the EngineConfig + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.EngineConfig]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// [google.cloud.financialservices.v1.GetEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L219} + /// + // clang-format on + StatusOr GetEngineConfig( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets an engine config. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.GetEngineConfigRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.EngineConfig]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// [google.cloud.financialservices.v1.GetEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L219} + /// + // clang-format on + StatusOr GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Creates an engine config. + /// + /// @param parent Required. The parent of the EngineConfig is the Instance. + /// @param engine_config Required. The EngineConfig that will be created. + /// @param engine_config_id Required. The resource id of the EngineConfig + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.EngineConfig] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L230} + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// + // clang-format on + future> + CreateEngineConfig( + std::string const& parent, + google::cloud::financialservices::v1::EngineConfig const& engine_config, + std::string const& engine_config_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEngineConfig + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateEngineConfig( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::EngineConfig const& engine_config, + std::string const& engine_config_id, Options opts = {}); + + // clang-format off + /// + /// Creates an engine config. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.CreateEngineConfigRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.EngineConfig] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreateEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L230} + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// + // clang-format on + future> + CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEngineConfig + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEngineConfig + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + CreateEngineConfig(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single EngineConfig. + /// + /// @param engine_config Required. The new value of the EngineConfig fields that will be updated + /// according to the update_mask. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// EngineConfig resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.EngineConfig] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// [google.cloud.financialservices.v1.UpdateEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L262} + /// + // clang-format on + future> + UpdateEngineConfig( + google::cloud::financialservices::v1::EngineConfig const& engine_config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEngineConfig + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::EngineConfig const& engine_config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single EngineConfig. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.UpdateEngineConfigRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.EngineConfig] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineConfig]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L32} + /// [google.cloud.financialservices.v1.UpdateEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L262} + /// + // clang-format on + future> + UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEngineConfig + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEngineConfig + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + UpdateEngineConfig(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Export governance information for an EngineConfig resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#engine-config). + /// + /// @param engine_config Required. The resource name of the EngineConfig. + /// @param structured_metadata_destination Required. BigQuery output where the metadata will be written. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportEngineConfigMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportEngineConfigMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L318} + /// [google.cloud.financialservices.v1.ExportEngineConfigMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L333} + /// + // clang-format on + future> + ExportEngineConfigMetadata( + std::string const& engine_config, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportEngineConfigMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportEngineConfigMetadata( + NoAwaitTag, std::string const& engine_config, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// Export governance information for an EngineConfig resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#engine-config). + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ExportEngineConfigMetadataRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportEngineConfigMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportEngineConfigMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L318} + /// [google.cloud.financialservices.v1.ExportEngineConfigMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L333} + /// + // clang-format on + future> + ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportEngineConfigMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportEngineConfigMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportEngineConfigMetadata + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + ExportEngineConfigMetadata(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes an engine config. + /// + /// @param name Required. The resource name of the EngineConfig. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L292} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteEngineConfig(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEngineConfig + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteEngineConfig( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes an engine config. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.DeleteEngineConfigRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteEngineConfigRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_config.proto#L292} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEngineConfig + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEngineConfig + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteEngineConfig(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Gets a single EngineVersion. + /// + /// @param name Required. The resource name of the EngineVersion + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.EngineVersion]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineVersion]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L31} + /// [google.cloud.financialservices.v1.GetEngineVersionRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L128} + /// + // clang-format on + StatusOr + GetEngineVersion(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a single EngineVersion. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.GetEngineVersionRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.EngineVersion]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineVersion]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L31} + /// [google.cloud.financialservices.v1.GetEngineVersionRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L128} + /// + // clang-format on + StatusOr + GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Lists EngineVersions for given location. + /// + /// @param parent Required. The parent of the EngineVersion is the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.EngineVersion], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineVersion]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L31} + /// [google.cloud.financialservices.v1.ListEngineVersionsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L84} + /// + // clang-format on + StreamRange + ListEngineVersions(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists EngineVersions for given 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.financialservices.v1.ListEngineVersionsRequest]. + /// Proto messages are converted to C++ 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.financialservices.v1.EngineVersion], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.EngineVersion]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L31} + /// [google.cloud.financialservices.v1.ListEngineVersionsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/engine_version.proto#L84} + /// + // clang-format on + StreamRange + ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request, + Options opts = {}); + + // clang-format off + /// + /// List PredictionResults. + /// + /// @param parent Required. The parent of the PredictionResult is the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.PredictionResult], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ListPredictionResultsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L131} + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// + // clang-format on + StreamRange + ListPredictionResults(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// List PredictionResults. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ListPredictionResultsRequest]. + /// Proto messages are converted to C++ 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.financialservices.v1.PredictionResult], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ListPredictionResultsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L131} + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// + // clang-format on + StreamRange + ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest + request, + Options opts = {}); + + // clang-format off + /// + /// Gets a PredictionResult. + /// + /// @param name Required. The resource name of the PredictionResult + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.PredictionResult]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.GetPredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L174} + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// + // clang-format on + StatusOr + GetPredictionResult(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a PredictionResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.GetPredictionResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.PredictionResult]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.GetPredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L174} + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// + // clang-format on + StatusOr + GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Create a PredictionResult. + /// + /// @param parent Required. The parent of the PredictionResult is the Instance. + /// @param prediction_result Required. The PredictionResult that will be created. + /// @param prediction_result_id Required. The resource id of the PredictionResult + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.PredictionResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreatePredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L185} + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// + // clang-format on + future> + CreatePredictionResult( + std::string const& parent, + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + std::string const& prediction_result_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreatePredictionResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreatePredictionResult( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + std::string const& prediction_result_id, Options opts = {}); + + // clang-format off + /// + /// Create a PredictionResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.CreatePredictionResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.PredictionResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.CreatePredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L185} + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// + // clang-format on + future> + CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreatePredictionResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreatePredictionResult + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + CreatePredictionResult(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single PredictionResult. + /// + /// @param prediction_result Required. The new value of the PredictionResult fields that will be updated + /// according to the update_mask. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// PredictionResult resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.PredictionResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// [google.cloud.financialservices.v1.UpdatePredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L218} + /// + // clang-format on + future> + UpdatePredictionResult( + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdatePredictionResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::PredictionResult const& + prediction_result, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single PredictionResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.UpdatePredictionResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.PredictionResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.PredictionResult]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L32} + /// [google.cloud.financialservices.v1.UpdatePredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L218} + /// + // clang-format on + future> + UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdatePredictionResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdatePredictionResult + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + UpdatePredictionResult(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Export governance information for a PredictionResult resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#prediction-results). + /// + /// @param prediction_result Required. The resource name of the PredictionResult. + /// @param structured_metadata_destination Required. BigQuery output where the metadata will be written. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportPredictionResultMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportPredictionResultMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L275} + /// [google.cloud.financialservices.v1.ExportPredictionResultMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L290} + /// + // clang-format on + future> + ExportPredictionResultMetadata( + std::string const& prediction_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportPredictionResultMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportPredictionResultMetadata( + NoAwaitTag, std::string const& prediction_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// Export governance information for a PredictionResult resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#prediction-results). + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ExportPredictionResultMetadataRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportPredictionResultMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportPredictionResultMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L275} + /// [google.cloud.financialservices.v1.ExportPredictionResultMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L290} + /// + // clang-format on + future> + ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportPredictionResultMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportPredictionResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportPredictionResultMetadata + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + ExportPredictionResultMetadata( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a PredictionResult. + /// + /// @param name Required. The resource name of the PredictionResult. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeletePredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L249} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeletePredictionResult(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeletePredictionResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeletePredictionResult( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a PredictionResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.DeletePredictionResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeletePredictionResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/prediction_result.proto#L249} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeletePredictionResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeletePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeletePredictionResult + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeletePredictionResult(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// List BacktestResults. + /// + /// @param parent Required. The parent of the BacktestResult is the Instance. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.financialservices.v1.BacktestResult], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.ListBacktestResultsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L132} + /// + // clang-format on + StreamRange + ListBacktestResults(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// List BacktestResults. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ListBacktestResultsRequest]. + /// Proto messages are converted to C++ 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.financialservices.v1.BacktestResult], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.ListBacktestResultsRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L132} + /// + // clang-format on + StreamRange + ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets a BacktestResult. + /// + /// @param name Required. The resource name of the BacktestResult + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.BacktestResult]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.GetBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L175} + /// + // clang-format on + StatusOr + GetBacktestResult(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a BacktestResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.GetBacktestResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.financialservices.v1.BacktestResult]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.GetBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L175} + /// + // clang-format on + StatusOr + GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Create a BacktestResult. + /// + /// @param parent Required. The parent of the BacktestResult is the Instance. + /// @param backtest_result Required. The BacktestResult that will be created. + /// @param backtest_result_id Required. The resource id of the BacktestResult + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.BacktestResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.CreateBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L186} + /// + // clang-format on + future> + CreateBacktestResult( + std::string const& parent, + google::cloud::financialservices::v1::BacktestResult const& + backtest_result, + std::string const& backtest_result_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateBacktestResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateBacktestResult( + NoAwaitTag, std::string const& parent, + google::cloud::financialservices::v1::BacktestResult const& + backtest_result, + std::string const& backtest_result_id, Options opts = {}); + + // clang-format off + /// + /// Create a BacktestResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.CreateBacktestResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.BacktestResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.CreateBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L186} + /// + // clang-format on + future> + CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateBacktestResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateBacktestResult + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + CreateBacktestResult(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single BacktestResult. + /// + /// @param backtest_result Required. The new value of the BacktestResult fields that will be updated + /// according to the update_mask. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// BacktestResult resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.BacktestResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.UpdateBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L218} + /// + // clang-format on + future> + UpdateBacktestResult( + google::cloud::financialservices::v1::BacktestResult const& + backtest_result, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateBacktestResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::BacktestResult const& + backtest_result, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single BacktestResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.UpdateBacktestResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.BacktestResult] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.BacktestResult]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L32} + /// [google.cloud.financialservices.v1.UpdateBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L218} + /// + // clang-format on + future> + UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateBacktestResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateBacktestResult + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + UpdateBacktestResult(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Export governance information for a BacktestResult resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#backtest-results). + /// + /// @param backtest_result Required. The resource name of the BacktestResult. + /// @param structured_metadata_destination Required. BigQuery output where the metadata will be written. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportBacktestResultMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportBacktestResultMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L274} + /// [google.cloud.financialservices.v1.ExportBacktestResultMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L289} + /// + // clang-format on + future> + ExportBacktestResultMetadata( + std::string const& backtest_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportBacktestResultMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportBacktestResultMetadata( + NoAwaitTag, std::string const& backtest_result, + google::cloud::financialservices::v1::BigQueryDestination const& + structured_metadata_destination, + Options opts = {}); + + // clang-format off + /// + /// Export governance information for a BacktestResult resource. For + /// information on the exported fields, see + /// [AML output data + /// model](https://cloud.google.com/financial-services/anti-money-laundering/docs/reference/schemas/aml-output-data-model#backtest-results). + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.ExportBacktestResultMetadataRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.v1.ExportBacktestResultMetadataResponse] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.financialservices.v1.ExportBacktestResultMetadataRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L274} + /// [google.cloud.financialservices.v1.ExportBacktestResultMetadataResponse]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L289} + /// + // clang-format on + future> + ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportBacktestResultMetadata + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ExportBacktestResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportBacktestResultMetadata + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + ExportBacktestResultMetadata(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a BacktestResult. + /// + /// @param name Required. The resource name of the BacktestResult. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L248} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteBacktestResult(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteBacktestResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteBacktestResult( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a BacktestResult. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.financialservices.v1.DeleteBacktestResultRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.financialservices.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.financialservices.v1.DeleteBacktestResultRequest]: @googleapis_reference_link{google/cloud/financialservices/v1/backtest_result.proto#L248} + /// [google.cloud.financialservices.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/financialservices/v1/service.proto#L517} + /// + // clang-format on + future> + DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteBacktestResult + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteBacktestResult + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteBacktestResult(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists information about the supported locations for this service. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.location.ListLocationsRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.location.Location], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.location.ListLocationsRequest]: @googleapis_reference_link{google/cloud/location/locations.proto#L58} + /// [google.cloud.location.Location]: @googleapis_reference_link{google/cloud/location/locations.proto#L88} + /// + // clang-format on + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets information about a location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.location.GetLocationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.location.Location]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.location.GetLocationRequest]: @googleapis_reference_link{google/cloud/location/locations.proto#L82} + /// [google.cloud.location.Location]: @googleapis_reference_link{google/cloud/location/locations.proto#L88} + /// + // clang-format on + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// @param name The name of the operation's parent resource. + /// @param filter The standard list filter. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.longrunning.Operation], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.ListOperationsRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L167} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StreamRange ListOperations( + std::string const& name, std::string const& filter, Options opts = {}); + + // clang-format off + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.ListOperationsRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.longrunning.Operation], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.ListOperationsRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L167} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// @param name The name of the operation resource. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.longrunning.Operation]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.GetOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L160} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StatusOr GetOperation(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.GetOperationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.longrunning.Operation]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.GetOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L160} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// @param name The name of the operation resource to be deleted. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.DeleteOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L200} + /// + // clang-format on + Status DeleteOperation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.DeleteOperationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.DeleteOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L200} + /// + // clang-format on + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an [Operation.error][google.longrunning.Operation.error] value with a + /// [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + /// `Code.CANCELLED`. + /// + /// @param name The name of the operation resource to be cancelled. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L193} + /// [google.longrunning.Operation.error]: @googleapis_reference_link{google/longrunning/operations.proto#L144} + /// [google.longrunning.Operations.GetOperation]: @googleapis_reference_link{google/longrunning/operations.proto#L70} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// + // clang-format on + Status CancelOperation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an [Operation.error][google.longrunning.Operation.error] value with a + /// [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + /// `Code.CANCELLED`. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.CancelOperationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L193} + /// [google.longrunning.Operation.error]: @googleapis_reference_link{google/longrunning/operations.proto#L144} + /// [google.longrunning.Operations.GetOperation]: @googleapis_reference_link{google/longrunning/operations.proto#L70} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// + // clang-format on + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request, + Options opts = {}); + + private: + std::shared_ptr connection_; + Options options_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CLIENT_H diff --git a/google/cloud/financialservices/v1/aml_connection.cc b/google/cloud/financialservices/v1/aml_connection.cc new file mode 100644 index 0000000000000..9865dd0e18943 --- /dev/null +++ b/google/cloud/financialservices/v1/aml_connection.cc @@ -0,0 +1,750 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/financialservices/v1/aml_options.h" +#include "google/cloud/financialservices/v1/internal/aml_connection_impl.h" +#include "google/cloud/financialservices/v1/internal/aml_option_defaults.h" +#include "google/cloud/financialservices/v1/internal/aml_stub_factory.h" +#include "google/cloud/financialservices/v1/internal/aml_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 financialservices_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AMLConnection::~AMLConnection() = default; + +StreamRange +AMLConnection::ListInstances( + google::cloud::financialservices::v1:: + ListInstancesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AMLConnection::GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AMLConnection::CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::CreateInstance(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateInstance(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteInstance(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ImportRegisteredParties( + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::ImportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ImportRegisteredParties(google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportRegisteredParties( + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::ExportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportRegisteredParties(google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AMLConnection::ListDatasets( + google::cloud::financialservices::v1:: + ListDatasetsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AMLConnection::GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AMLConnection::CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::CreateDataset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateDataset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteDataset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AMLConnection::ListModels( + google::cloud::financialservices::v1:: + ListModelsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AMLConnection::GetModel( + google::cloud::financialservices::v1::GetModelRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AMLConnection::CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::CreateModel(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateModel(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AMLConnection::ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AMLConnection::ExportModelMetadata(google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteModel(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AMLConnection::ListEngineConfigs( + google::cloud::financialservices::v1:: + ListEngineConfigsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AMLConnection::GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AMLConnection::CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::CreateEngineConfig(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateEngineConfig(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AMLConnection::ExportEngineConfigMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportEngineConfigMetadata( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteEngineConfig(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AMLConnection::GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AMLConnection::ListEngineVersions( + google::cloud::financialservices::v1:: + ListEngineVersionsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +AMLConnection::ListPredictionResults( + google::cloud::financialservices::v1:: + ListPredictionResultsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AMLConnection::GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AMLConnection::CreatePredictionResult( + google::cloud::financialservices::v1:: + CreatePredictionResultRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::CreatePredictionResult( + NoAwaitTag, google::cloud::financialservices::v1:: + CreatePredictionResultRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::CreatePredictionResult(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdatePredictionResult( + google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::UpdatePredictionResult( + NoAwaitTag, google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdatePredictionResult(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AMLConnection::ExportPredictionResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportPredictionResultMetadata( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeletePredictionResult( + google::cloud::financialservices::v1:: + DeletePredictionResultRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::DeletePredictionResult( + NoAwaitTag, google::cloud::financialservices::v1:: + DeletePredictionResultRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeletePredictionResult(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AMLConnection::ListBacktestResults( + google::cloud::financialservices::v1:: + ListBacktestResultsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AMLConnection::GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AMLConnection::CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::CreateBacktestResult(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::UpdateBacktestResult(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AMLConnection::ExportBacktestResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::ExportBacktestResultMetadata( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AMLConnection::DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AMLConnection::DeleteBacktestResult(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange AMLConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AMLConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange AMLConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AMLConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AMLConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AMLConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeAMLConnection(Options options) { + internal::CheckExpectedOptions(options, __func__); + options = + financialservices_v1_internal::AMLDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = financialservices_v1_internal::CreateDefaultAMLStub( + std::move(auth), options); + return financialservices_v1_internal::MakeAMLTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/aml_connection.h b/google/cloud/financialservices/v1/aml_connection.h new file mode 100644 index 0000000000000..80f2d830419f6 --- /dev/null +++ b/google/cloud/financialservices/v1/aml_connection.h @@ -0,0 +1,618 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_H + +#include "google/cloud/financialservices/v1/aml_connection_idempotency_policy.h" +#include "google/cloud/financialservices/v1/internal/aml_retry_traits.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/future.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/no_await_tag.h" +#include "google/cloud/options.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `AMLConnection`. +class AMLRetryPolicy : 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 `AMLConnection` 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 AMLLimitedErrorCountRetryPolicy : public AMLRetryPolicy { + 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 AMLLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + AMLLimitedErrorCountRetryPolicy( + AMLLimitedErrorCountRetryPolicy&& rhs) noexcept + : AMLLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + AMLLimitedErrorCountRetryPolicy( + AMLLimitedErrorCountRetryPolicy const& rhs) noexcept + : AMLLimitedErrorCountRetryPolicy(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 = AMLRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + financialservices_v1_internal::AMLRetryTraits> + impl_; +}; + +/** + * A retry policy for `AMLConnection` 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 AMLLimitedTimeRetryPolicy : public AMLRetryPolicy { + 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 AMLLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + AMLLimitedTimeRetryPolicy(AMLLimitedTimeRetryPolicy&& rhs) noexcept + : AMLLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + AMLLimitedTimeRetryPolicy(AMLLimitedTimeRetryPolicy const& rhs) noexcept + : AMLLimitedTimeRetryPolicy(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 = AMLRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + financialservices_v1_internal::AMLRetryTraits> + impl_; +}; + +/** + * The `AMLConnection` object for `AMLClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `AMLClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `AMLClient`. + * + * To create a concrete instance, see `MakeAMLConnection()`. + * + * For mocking, see `financialservices_v1_mocks::MockAMLConnection`. + */ +class AMLConnection { + public: + virtual ~AMLConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request); + + virtual StatusOr GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request); + + virtual future> + CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& + request); + + virtual StatusOr CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request); + + virtual future> + CreateInstance(google::longrunning::Operation const& operation); + + virtual future> + UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request); + + virtual StatusOr UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request); + + virtual future> + UpdateInstance(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request); + + virtual StatusOr DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request); + + virtual future< + StatusOr> + DeleteInstance(google::longrunning::Operation const& operation); + + virtual future> + ImportRegisteredParties(google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request); + + virtual StatusOr ImportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request); + + virtual future> + ImportRegisteredParties(google::longrunning::Operation const& operation); + + virtual future> + ExportRegisteredParties(google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request); + + virtual StatusOr ExportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request); + + virtual future> + ExportRegisteredParties(google::longrunning::Operation const& operation); + + virtual StreamRange + ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request); + + virtual StatusOr GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request); + + virtual future> + CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& + request); + + virtual StatusOr CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request); + + virtual future> + CreateDataset(google::longrunning::Operation const& operation); + + virtual future> + UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request); + + virtual StatusOr UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request); + + virtual future> + UpdateDataset(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request); + + virtual StatusOr DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request); + + virtual future< + StatusOr> + DeleteDataset(google::longrunning::Operation const& operation); + + virtual StreamRange ListModels( + google::cloud::financialservices::v1::ListModelsRequest request); + + virtual StatusOr GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request); + + virtual future> + CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request); + + virtual StatusOr CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request); + + virtual future> + CreateModel(google::longrunning::Operation const& operation); + + virtual future> + UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request); + + virtual StatusOr UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request); + + virtual future> + UpdateModel(google::longrunning::Operation const& operation); + + virtual future> + ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request); + + virtual StatusOr ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request); + + virtual future> + ExportModelMetadata(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const& request); + + virtual StatusOr DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request); + + virtual future< + StatusOr> + DeleteModel(google::longrunning::Operation const& operation); + + virtual StreamRange + ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request); + + virtual StatusOr + GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request); + + virtual future> + CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request); + + virtual StatusOr CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request); + + virtual future> + CreateEngineConfig(google::longrunning::Operation const& operation); + + virtual future> + UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request); + + virtual StatusOr UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request); + + virtual future> + UpdateEngineConfig(google::longrunning::Operation const& operation); + + virtual future> + ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request); + + virtual StatusOr ExportEngineConfigMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request); + + virtual future> + ExportEngineConfigMetadata(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request); + + virtual StatusOr DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request); + + virtual future< + StatusOr> + DeleteEngineConfig(google::longrunning::Operation const& operation); + + virtual StatusOr + GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request); + + virtual StreamRange + ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request); + + virtual StreamRange + ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest + request); + + virtual StatusOr + GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request); + + virtual future< + StatusOr> + CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request); + + virtual StatusOr CreatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request); + + virtual future< + StatusOr> + CreatePredictionResult(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request); + + virtual StatusOr UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request); + + virtual future< + StatusOr> + UpdatePredictionResult(google::longrunning::Operation const& operation); + + virtual future> + ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request); + + virtual StatusOr + ExportPredictionResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request); + + virtual future> + ExportPredictionResultMetadata( + google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request); + + virtual StatusOr DeletePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request); + + virtual future< + StatusOr> + DeletePredictionResult(google::longrunning::Operation const& operation); + + virtual StreamRange + ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request); + + virtual StatusOr + GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request); + + virtual future> + CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request); + + virtual StatusOr CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request); + + virtual future> + CreateBacktestResult(google::longrunning::Operation const& operation); + + virtual future> + UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request); + + virtual StatusOr UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request); + + virtual future> + UpdateBacktestResult(google::longrunning::Operation const& operation); + + virtual future> + ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request); + + virtual StatusOr ExportBacktestResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request); + + virtual future> + ExportBacktestResultMetadata(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request); + + virtual StatusOr DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request); + + virtual future< + StatusOr> + DeleteBacktestResult(google::longrunning::Operation const& operation); + + virtual StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request); + + virtual StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request); + + virtual StreamRange ListOperations( + google::longrunning::ListOperationsRequest request); + + virtual StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request); + + virtual Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request); + + virtual Status CancelOperation( + google::longrunning::CancelOperationRequest const& request); +}; + +/** + * A factory function to construct an object of type `AMLConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of AMLClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `AMLConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::financialservices_v1::AMLPolicyOptionList` + * + * @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 `AMLConnection` created by + * this function. + */ +std::shared_ptr MakeAMLConnection(Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_H diff --git a/google/cloud/financialservices/v1/aml_connection_idempotency_policy.cc b/google/cloud/financialservices/v1/aml_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..7730a4654d292 --- /dev/null +++ b/google/cloud/financialservices/v1/aml_connection_idempotency_policy.cc @@ -0,0 +1,275 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/aml_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace financialservices_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +AMLConnectionIdempotencyPolicy::~AMLConnectionIdempotencyPolicy() = default; + +std::unique_ptr +AMLConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency AMLConnectionIdempotencyPolicy::ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ImportRegisteredParties( + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ExportRegisteredParties( + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListModels( + google::cloud::financialservices::v1::ListModelsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetModel( + google::cloud::financialservices::v1::GetModelRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListEngineVersions( + google::cloud::financialservices::v1:: + ListEngineVersionsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListPredictionResults( + google::cloud::financialservices::v1:: + ListPredictionResultsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::CreatePredictionResult( + google::cloud::financialservices::v1:: + CreatePredictionResultRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::UpdatePredictionResult( + google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::DeletePredictionResult( + google::cloud::financialservices::v1:: + DeletePredictionResultRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListBacktestResults( + google::cloud::financialservices::v1:: + ListBacktestResultsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AMLConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultAMLConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/aml_connection_idempotency_policy.h b/google/cloud/financialservices/v1/aml_connection_idempotency_policy.h new file mode 100644 index 0000000000000..3eea78edc8fcf --- /dev/null +++ b/google/cloud/financialservices/v1/aml_connection_idempotency_policy.h @@ -0,0 +1,208 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AMLConnectionIdempotencyPolicy { + public: + virtual ~AMLConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() const; + + virtual google::cloud::Idempotency ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request); + + virtual google::cloud::Idempotency GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request); + + virtual google::cloud::Idempotency CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& + request); + + virtual google::cloud::Idempotency UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request); + + virtual google::cloud::Idempotency DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request); + + virtual google::cloud::Idempotency ImportRegisteredParties( + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request); + + virtual google::cloud::Idempotency ExportRegisteredParties( + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request); + + virtual google::cloud::Idempotency ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request); + + virtual google::cloud::Idempotency GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request); + + virtual google::cloud::Idempotency CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& + request); + + virtual google::cloud::Idempotency UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request); + + virtual google::cloud::Idempotency DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request); + + virtual google::cloud::Idempotency ListModels( + google::cloud::financialservices::v1::ListModelsRequest request); + + virtual google::cloud::Idempotency GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request); + + virtual google::cloud::Idempotency CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request); + + virtual google::cloud::Idempotency UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request); + + virtual google::cloud::Idempotency ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request); + + virtual google::cloud::Idempotency DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const& request); + + virtual google::cloud::Idempotency ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request); + + virtual google::cloud::Idempotency GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request); + + virtual google::cloud::Idempotency CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request); + + virtual google::cloud::Idempotency UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request); + + virtual google::cloud::Idempotency ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request); + + virtual google::cloud::Idempotency DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request); + + virtual google::cloud::Idempotency GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request); + + virtual google::cloud::Idempotency ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request); + + virtual google::cloud::Idempotency ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest + request); + + virtual google::cloud::Idempotency GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request); + + virtual google::cloud::Idempotency CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request); + + virtual google::cloud::Idempotency UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request); + + virtual google::cloud::Idempotency ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request); + + virtual google::cloud::Idempotency DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request); + + virtual google::cloud::Idempotency ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request); + + virtual google::cloud::Idempotency GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request); + + virtual google::cloud::Idempotency CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request); + + virtual google::cloud::Idempotency UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request); + + virtual google::cloud::Idempotency ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request); + + virtual google::cloud::Idempotency DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request); + + virtual google::cloud::Idempotency ListLocations( + google::cloud::location::ListLocationsRequest request); + + virtual google::cloud::Idempotency GetLocation( + google::cloud::location::GetLocationRequest const& request); + + virtual google::cloud::Idempotency ListOperations( + google::longrunning::ListOperationsRequest request); + + virtual google::cloud::Idempotency GetOperation( + google::longrunning::GetOperationRequest const& request); + + virtual google::cloud::Idempotency DeleteOperation( + google::longrunning::DeleteOperationRequest const& request); + + virtual google::cloud::Idempotency CancelOperation( + google::longrunning::CancelOperationRequest const& request); +}; + +std::unique_ptr +MakeDefaultAMLConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/financialservices/v1/aml_options.h b/google/cloud/financialservices/v1/aml_options.h new file mode 100644 index 0000000000000..0dcf03bf9a736 --- /dev/null +++ b/google/cloud/financialservices/v1/aml_options.h @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_OPTIONS_H + +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/financialservices/v1/aml_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 financialservices_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-financialservices-options + */ +struct AMLRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-financialservices-options + */ +struct AMLBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-financialservices-options + */ +struct AMLConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-financialservices-options + */ +struct AMLPollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to AML. + * + * @ingroup google-cloud-financialservices-options + */ +using AMLPolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_AML_OPTIONS_H diff --git a/google/cloud/financialservices/v1/internal/aml_auth_decorator.cc b/google/cloud/financialservices/v1/internal/aml_auth_decorator.cc new file mode 100644 index 0000000000000..384ac2c136f35 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_auth_decorator.cc @@ -0,0 +1,951 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_auth_decorator.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AMLAuth::AMLAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +AMLAuth::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListInstances(context, options, request); +} + +StatusOr AMLAuth::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetInstance(context, options, request); +} + +future> AMLAuth::AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateInstance(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateInstance(context, options, request); +} + +future> AMLAuth::AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateInstance(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateInstance(context, options, request); +} + +future> AMLAuth::AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteInstance(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteInstance(context, options, request); +} + +future> +AMLAuth::AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncImportRegisteredParties(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ImportRegisteredParties(context, options, request); +} + +future> +AMLAuth::AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncExportRegisteredParties(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExportRegisteredParties(context, options, request); +} + +StatusOr +AMLAuth::ListDatasets( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListDatasets(context, options, request); +} + +StatusOr AMLAuth::GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetDataset(context, options, request); +} + +future> AMLAuth::AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateDataset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateDataset(context, options, request); +} + +future> AMLAuth::AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateDataset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateDataset(context, options, request); +} + +future> AMLAuth::AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteDataset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteDataset(context, options, request); +} + +StatusOr +AMLAuth::ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListModels(context, options, request); +} + +StatusOr AMLAuth::GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetModel(context, options, request); +} + +future> AMLAuth::AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateModel(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateModel(context, options, request); +} + +future> AMLAuth::AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateModel(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateModel(context, options, request); +} + +future> +AMLAuth::AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncExportModelMetadata(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExportModelMetadata(context, options, request); +} + +future> AMLAuth::AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteModel(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteModel(context, options, request); +} + +StatusOr +AMLAuth::ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListEngineConfigs(context, options, request); +} + +StatusOr +AMLAuth::GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetEngineConfig(context, options, request); +} + +future> +AMLAuth::AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateEngineConfig(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateEngineConfig(context, options, request); +} + +future> +AMLAuth::AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateEngineConfig(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateEngineConfig(context, options, request); +} + +future> +AMLAuth::AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncExportEngineConfigMetadata( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr AMLAuth::ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExportEngineConfigMetadata(context, options, request); +} + +future> +AMLAuth::AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteEngineConfig(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteEngineConfig(context, options, request); +} + +StatusOr +AMLAuth::GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetEngineVersion(context, options, request); +} + +StatusOr +AMLAuth::ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListEngineVersions(context, options, request); +} + +StatusOr +AMLAuth::ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListPredictionResults(context, options, request); +} + +StatusOr +AMLAuth::GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetPredictionResult(context, options, request); +} + +future> +AMLAuth::AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreatePredictionResult(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreatePredictionResult(context, options, request); +} + +future> +AMLAuth::AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdatePredictionResult(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdatePredictionResult(context, options, request); +} + +future> +AMLAuth::AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncExportPredictionResultMetadata( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AMLAuth::ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExportPredictionResultMetadata(context, options, request); +} + +future> +AMLAuth::AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeletePredictionResult(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeletePredictionResult(context, options, request); +} + +StatusOr +AMLAuth::ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListBacktestResults(context, options, request); +} + +StatusOr +AMLAuth::GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetBacktestResult(context, options, request); +} + +future> +AMLAuth::AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateBacktestResult(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateBacktestResult(context, options, request); +} + +future> +AMLAuth::AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateBacktestResult(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateBacktestResult(context, options, request); +} + +future> +AMLAuth::AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncExportBacktestResultMetadata( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr AMLAuth::ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExportBacktestResultMetadata(context, options, request); +} + +future> +AMLAuth::AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteBacktestResult(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AMLAuth::DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteBacktestResult(context, options, request); +} + +StatusOr AMLAuth::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 AMLAuth::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 AMLAuth::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 AMLAuth::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 AMLAuth::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 AMLAuth::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> AMLAuth::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 AMLAuth::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 financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_auth_decorator.h b/google/cloud/financialservices/v1/internal/aml_auth_decorator.h new file mode 100644 index 0000000000000..24309fc6a0bd9 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_auth_decorator.h @@ -0,0 +1,457 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_AUTH_DECORATOR_H + +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AMLAuth : public AMLStub { + public: + ~AMLAuth() override = default; + AMLAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) + override; + + future> AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + StatusOr CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + future> AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + StatusOr UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + future> AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + StatusOr DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + future> AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + StatusOr ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + future> AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr + ListDatasets(grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) override; + + StatusOr GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) + override; + + future> AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + StatusOr CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + future> AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + StatusOr UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + future> AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) + override; + + StatusOr GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) + override; + + future> AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + StatusOr CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + future> AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + StatusOr UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + future> AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + StatusOr ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + future> AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr + ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) override; + + StatusOr GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) override; + + future> AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + StatusOr CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + future> AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + StatusOr UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + future> + AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + StatusOr ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + future> AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr + GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) override; + + StatusOr + ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) override; + + StatusOr + ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) override; + + StatusOr + GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) override; + + future> AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + StatusOr CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + future> AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + StatusOr UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + future> + AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + StatusOr ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + future> AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr + ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) override; + + StatusOr + GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) override; + + future> AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + StatusOr CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + future> AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + StatusOr UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + future> + AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + StatusOr ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + future> AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_AUTH_DECORATOR_H diff --git a/google/cloud/financialservices/v1/internal/aml_connection_impl.cc b/google/cloud/financialservices/v1/internal/aml_connection_impl.cc new file mode 100644 index 0000000000000..ca62876d3a90b --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_connection_impl.cc @@ -0,0 +1,2839 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_connection_impl.h" +#include "google/cloud/financialservices/v1/internal/aml_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 financialservices_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 + +AMLConnectionImpl::AMLConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + AMLConnection::options())) {} + +StreamRange +AMLConnectionImpl::ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListInstances(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ListInstancesRequest const& request) { + return stub->ListInstances(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::financialservices::v1::ListInstancesResponse r) { + std::vector result( + r.instances().size()); + auto& messages = *r.mutable_instances(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AMLConnectionImpl::GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetInstance(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& + request) { + return stub_->GetInstance(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateInstance(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::Instance>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + return stub->AsyncCreateInstance(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Instance>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateInstance(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + return stub_->CreateInstance(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateInstance( + 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 CreateInstance", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::Instance>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Instance>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateInstance(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::Instance>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + return stub->AsyncUpdateInstance(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Instance>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateInstance(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + return stub_->UpdateInstance(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::UpdateInstance( + 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 UpdateInstance", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::Instance>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Instance>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteInstance(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::DeleteInstanceRequest const& + request) { + return stub->AsyncDeleteInstance(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + 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::financialservices::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteInstance(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + return stub_->DeleteInstance(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::DeleteInstance( + 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 DeleteInstance", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::ImportRegisteredParties( + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ImportRegisteredParties(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::ImportRegisteredPartiesResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) { + return stub->AsyncImportRegisteredParties(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ImportRegisteredPartiesResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::ImportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ImportRegisteredParties(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) { + return stub_->ImportRegisteredParties(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::ImportRegisteredParties( + 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 ImportRegisteredParties", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::ImportRegisteredPartiesResponse>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ImportRegisteredPartiesResponse>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::ExportRegisteredParties( + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ExportRegisteredParties(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::ExportRegisteredPartiesResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) { + return stub->AsyncExportRegisteredParties(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportRegisteredPartiesResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::ExportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExportRegisteredParties(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) { + return stub_->ExportRegisteredParties(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::ExportRegisteredParties( + 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 ExportRegisteredParties", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::ExportRegisteredPartiesResponse>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportRegisteredPartiesResponse>, + polling_policy(*current), __func__); +} + +StreamRange +AMLConnectionImpl::ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListDatasets(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::financialservices::v1::ListDatasetsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) { + return stub->ListDatasets(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::financialservices::v1::ListDatasetsResponse r) { + std::vector result( + r.datasets().size()); + auto& messages = *r.mutable_datasets(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AMLConnectionImpl::GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetDataset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& + request) { + return stub_->GetDataset(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateDataset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::Dataset>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request) { + return stub->AsyncCreateDataset(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Dataset>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateDataset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request) { + return stub_->CreateDataset(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateDataset( + 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 CreateDataset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::Dataset>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Dataset>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateDataset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::Dataset>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request) { + return stub->AsyncUpdateDataset(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Dataset>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateDataset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request) { + return stub_->UpdateDataset(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::UpdateDataset( + 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 UpdateDataset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::Dataset>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Dataset>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteDataset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::DeleteDatasetRequest const& + request) { + return stub->AsyncDeleteDataset(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + 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::financialservices::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteDataset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request) { + return stub_->DeleteDataset(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::DeleteDataset( + 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 DeleteDataset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +AMLConnectionImpl::ListModels( + google::cloud::financialservices::v1::ListModelsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListModels(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::financialservices::v1::ListModelsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& + request) { + return stub->ListModels(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::financialservices::v1::ListModelsResponse r) { + std::vector result( + r.models().size()); + auto& messages = *r.mutable_models(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AMLConnectionImpl::GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetModel(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& + request) { + return stub_->GetModel(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateModel(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::Model>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& + request) { + return stub->AsyncCreateModel(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Model>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateModel(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateModelRequest const& + request) { + return stub_->CreateModel(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateModel( + 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 CreateModel", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::Model>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Model>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateModel(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::Model>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& + request) { + return stub->AsyncUpdateModel(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Model>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateModel(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateModelRequest const& + request) { + return stub_->UpdateModel(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::UpdateModel( + 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 UpdateModel", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::Model>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::Model>, + polling_policy(*current), __func__); +} + +future< + StatusOr> +AMLConnectionImpl::ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ExportModelMetadata(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::ExportModelMetadataResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportModelMetadataRequest const& request) { + return stub->AsyncExportModelMetadata(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::ExportModelMetadataResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExportModelMetadata(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportModelMetadataRequest const& request) { + return stub_->ExportModelMetadata(context, options, request); + }, + *current, request, __func__); +} + +future< + StatusOr> +AMLConnectionImpl::ExportModelMetadata( + 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 ExportModelMetadata", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::ExportModelMetadataResponse>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::ExportModelMetadataResponse>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteModel(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::DeleteModelRequest const& + request) { + return stub->AsyncDeleteModel(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + 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::financialservices::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteModel(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteModelRequest const& + request) { + return stub_->DeleteModel(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::DeleteModel( + 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 DeleteModel", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +AMLConnectionImpl::ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListEngineConfigs(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::financialservices::v1::ListEngineConfigsRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ListEngineConfigsRequest const& request) { + return stub->ListEngineConfigs(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::financialservices::v1::ListEngineConfigsResponse r) { + std::vector result( + r.engine_configs().size()); + auto& messages = *r.mutable_engine_configs(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AMLConnectionImpl::GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetEngineConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + return stub_->GetEngineConfig(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateEngineConfig(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::EngineConfig>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + return stub->AsyncCreateEngineConfig(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::EngineConfig>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateEngineConfig(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + return stub_->CreateEngineConfig(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateEngineConfig( + 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 CreateEngineConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::EngineConfig>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::EngineConfig>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateEngineConfig(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::EngineConfig>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + return stub->AsyncUpdateEngineConfig(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::EngineConfig>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateEngineConfig(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + return stub_->UpdateEngineConfig(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::UpdateEngineConfig( + 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 UpdateEngineConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::EngineConfig>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::EngineConfig>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ExportEngineConfigMetadata(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::ExportEngineConfigMetadataResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + return stub->AsyncExportEngineConfigMetadata( + cq, std::move(context), std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::ExportEngineConfigMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExportEngineConfigMetadata(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + return stub_->ExportEngineConfigMetadata(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::ExportEngineConfigMetadata( + 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 ExportEngineConfigMetadata", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::ExportEngineConfigMetadataResponse>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataResponse>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteEngineConfig(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::DeleteEngineConfigRequest const& + request) { + return stub->AsyncDeleteEngineConfig(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + 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::financialservices::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AMLConnectionImpl::DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteEngineConfig(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + return stub_->DeleteEngineConfig(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::DeleteEngineConfig( + 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 DeleteEngineConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetEngineVersion(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + return stub_->GetEngineVersion(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AMLConnectionImpl::ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListEngineVersions(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::financialservices::v1::ListEngineVersionsRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ListEngineVersionsRequest const& request) { + return stub->ListEngineVersions(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::financialservices::v1::ListEngineVersionsResponse r) { + std::vector result( + r.engine_versions().size()); + auto& messages = *r.mutable_engine_versions(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +AMLConnectionImpl::ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest + request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListPredictionResults(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::financialservices::v1:: + ListPredictionResultsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ListPredictionResultsRequest const& request) { + return stub->ListPredictionResults(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::financialservices::v1::ListPredictionResultsResponse + r) { + std::vector + result(r.prediction_results().size()); + auto& messages = *r.mutable_prediction_results(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AMLConnectionImpl::GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetPredictionResult(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + GetPredictionResultRequest const& request) { + return stub_->GetPredictionResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreatePredictionResult(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::PredictionResult>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + CreatePredictionResultRequest const& request) { + return stub->AsyncCreatePredictionResult(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::PredictionResult>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::CreatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreatePredictionResult(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + CreatePredictionResultRequest const& request) { + return stub_->CreatePredictionResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreatePredictionResult( + 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 CreatePredictionResult", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::PredictionResult>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::PredictionResult>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdatePredictionResult(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::PredictionResult>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const& request) { + return stub->AsyncUpdatePredictionResult(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::PredictionResult>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdatePredictionResult(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const& request) { + return stub_->UpdatePredictionResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::UpdatePredictionResult( + 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 UpdatePredictionResult", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::PredictionResult>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::PredictionResult>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ExportPredictionResultMetadata( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + return stub->AsyncExportPredictionResultMetadata( + cq, std::move(context), std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::ExportPredictionResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExportPredictionResultMetadata(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + return stub_->ExportPredictionResultMetadata(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::ExportPredictionResultMetadata( + 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 ExportPredictionResultMetadata", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataResponse>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataResponse>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeletePredictionResult(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1:: + DeletePredictionResultRequest const& request) { + return stub->AsyncDeletePredictionResult(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + 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::financialservices::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::DeletePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeletePredictionResult(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + DeletePredictionResultRequest const& request) { + return stub_->DeletePredictionResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::DeletePredictionResult( + 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 DeletePredictionResult", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +AMLConnectionImpl::ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListBacktestResults(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::financialservices::v1:: + ListBacktestResultsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ListBacktestResultsRequest const& request) { + return stub->ListBacktestResults(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::financialservices::v1::ListBacktestResultsResponse r) { + std::vector + result(r.backtest_results().size()); + auto& messages = *r.mutable_backtest_results(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AMLConnectionImpl::GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetBacktestResult(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + return stub_->GetBacktestResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateBacktestResult(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::BacktestResult>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + CreateBacktestResultRequest const& request) { + return stub->AsyncCreateBacktestResult(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::BacktestResult>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateBacktestResult(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + CreateBacktestResultRequest const& request) { + return stub_->CreateBacktestResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::CreateBacktestResult( + 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 CreateBacktestResult", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::BacktestResult>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::BacktestResult>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateBacktestResult(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1::BacktestResult>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + UpdateBacktestResultRequest const& request) { + return stub->AsyncUpdateBacktestResult(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::BacktestResult>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateBacktestResult(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + UpdateBacktestResultRequest const& request) { + return stub_->UpdateBacktestResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::UpdateBacktestResult( + 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 UpdateBacktestResult", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1::BacktestResult>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1::BacktestResult>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ExportBacktestResultMetadata(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + return stub->AsyncExportBacktestResultMetadata( + cq, std::move(context), std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::ExportBacktestResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExportBacktestResultMetadata(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + return stub_->ExportBacktestResultMetadata(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::ExportBacktestResultMetadata( + 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 ExportBacktestResultMetadata", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataResponse>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataResponse>, + polling_policy(*current), __func__); +} + +future> +AMLConnectionImpl::DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteBacktestResult(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1:: + DeleteBacktestResultRequest const& request) { + return stub->AsyncDeleteBacktestResult(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + 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::financialservices::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AMLConnectionImpl::DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteBacktestResult(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + DeleteBacktestResultRequest const& request) { + return stub_->DeleteBacktestResult(context, options, request); + }, + *current, request, __func__); +} + +future> +AMLConnectionImpl::DeleteBacktestResult( + 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 DeleteBacktestResult", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::financialservices::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::financialservices::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange AMLConnectionImpl::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 AMLConnectionImpl::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetLocation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + return stub_->GetLocation(context, options, request); + }, + *current, request, __func__); +} + +StreamRange AMLConnectionImpl::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 AMLConnectionImpl::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 AMLConnectionImpl::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 AMLConnectionImpl::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 financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_connection_impl.h b/google/cloud/financialservices/v1/internal/aml_connection_impl.h new file mode 100644 index 0000000000000..287594ed47c77 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_connection_impl.h @@ -0,0 +1,473 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_CONNECTION_IMPL_H + +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/financialservices/v1/aml_connection_idempotency_policy.h" +#include "google/cloud/financialservices/v1/aml_options.h" +#include "google/cloud/financialservices/v1/internal/aml_retry_traits.h" +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/future.h" +#include "google/cloud/options.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AMLConnectionImpl : public financialservices_v1::AMLConnection { + public: + ~AMLConnectionImpl() override = default; + + AMLConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StreamRange ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request) + override; + + StatusOr GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request) + override; + + future> + CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + StatusOr CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + future> + CreateInstance(google::longrunning::Operation const& operation) override; + + future> + UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + StatusOr UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + future> + UpdateInstance(google::longrunning::Operation const& operation) override; + + future> + DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + StatusOr DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + future> + DeleteInstance(google::longrunning::Operation const& operation) override; + + future> + ImportRegisteredParties( + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + StatusOr ImportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + future> + ImportRegisteredParties( + google::longrunning::Operation const& operation) override; + + future> + ExportRegisteredParties( + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr ExportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + future> + ExportRegisteredParties( + google::longrunning::Operation const& operation) override; + + StreamRange ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request) + override; + + StatusOr GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request) + override; + + future> CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + StatusOr CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + future> CreateDataset( + google::longrunning::Operation const& operation) override; + + future> UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + StatusOr UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + future> UpdateDataset( + google::longrunning::Operation const& operation) override; + + future> + DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + future> + DeleteDataset(google::longrunning::Operation const& operation) override; + + StreamRange ListModels( + google::cloud::financialservices::v1::ListModelsRequest request) override; + + StatusOr GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request) + override; + + future> CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + StatusOr CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + future> CreateModel( + google::longrunning::Operation const& operation) override; + + future> UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + StatusOr UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + future> UpdateModel( + google::longrunning::Operation const& operation) override; + + future> + ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + StatusOr ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + future> + ExportModelMetadata(google::longrunning::Operation const& operation) override; + + future> + DeleteModel(google::cloud::financialservices::v1::DeleteModelRequest const& + request) override; + + StatusOr DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + future> + DeleteModel(google::longrunning::Operation const& operation) override; + + StreamRange + ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request) + override; + + StatusOr GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) override; + + future> + CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + StatusOr CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + future> + CreateEngineConfig(google::longrunning::Operation const& operation) override; + + future> + UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + StatusOr UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + future> + UpdateEngineConfig(google::longrunning::Operation const& operation) override; + + future> + ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + StatusOr ExportEngineConfigMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + future> + ExportEngineConfigMetadata( + google::longrunning::Operation const& operation) override; + + future> + DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + future> + DeleteEngineConfig(google::longrunning::Operation const& operation) override; + + StatusOr + GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) override; + + StreamRange + ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request) + override; + + StreamRange + ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest + request) override; + + StatusOr + GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) override; + + future> + CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + StatusOr CreatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + future> + CreatePredictionResult( + google::longrunning::Operation const& operation) override; + + future> + UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + StatusOr UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + future> + UpdatePredictionResult( + google::longrunning::Operation const& operation) override; + + future> + ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + StatusOr ExportPredictionResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + future> + ExportPredictionResultMetadata( + google::longrunning::Operation const& operation) override; + + future> + DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr DeletePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + future> + DeletePredictionResult( + google::longrunning::Operation const& operation) override; + + StreamRange + ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request) + override; + + StatusOr + GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) override; + + future> + CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + StatusOr CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + future> + CreateBacktestResult( + google::longrunning::Operation const& operation) override; + + future> + UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + StatusOr UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + future> + UpdateBacktestResult( + google::longrunning::Operation const& operation) override; + + future> + ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + StatusOr ExportBacktestResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + future> + ExportBacktestResultMetadata( + google::longrunning::Operation const& operation) override; + + future> + DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + future> + DeleteBacktestResult( + google::longrunning::Operation const& operation) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request) override; + + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::unique_ptr background_; + std::shared_ptr stub_; + Options options_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_CONNECTION_IMPL_H diff --git a/google/cloud/financialservices/v1/internal/aml_logging_decorator.cc b/google/cloud/financialservices/v1/internal/aml_logging_decorator.cc new file mode 100644 index 0000000000000..3e82b5bf591cf --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_logging_decorator.cc @@ -0,0 +1,1118 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_logging_decorator.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AMLLogging::AMLLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +AMLLogging::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& + request) { + return child_->ListInstances(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& + request) { + return child_->GetInstance(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + return child_->AsyncCreateInstance(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + return child_->CreateInstance(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + return child_->AsyncUpdateInstance(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + return child_->UpdateInstance(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + return child_->AsyncDeleteInstance(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + return child_->DeleteInstance(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) { + return child_->AsyncImportRegisteredParties( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) { + return child_->ImportRegisteredParties(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) { + return child_->AsyncExportRegisteredParties( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) { + return child_->ExportRegisteredParties(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::ListDatasets( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) { + return child_->ListDatasets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AMLLogging::GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& + request) { + return child_->GetDataset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> AMLLogging::AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request) { + return child_->AsyncCreateDataset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request) { + return child_->CreateDataset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> AMLLogging::AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request) { + return child_->AsyncUpdateDataset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request) { + return child_->UpdateDataset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> AMLLogging::AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request) { + return child_->AsyncDeleteDataset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request) { + return child_->DeleteDataset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& + request) { + return child_->ListModels(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AMLLogging::GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& + request) { + return child_->GetModel(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> AMLLogging::AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& + request) { + return child_->AsyncCreateModel(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateModelRequest const& + request) { + return child_->CreateModel(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> AMLLogging::AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& + request) { + return child_->AsyncUpdateModel(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateModelRequest const& + request) { + return child_->UpdateModel(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportModelMetadataRequest const& request) { + return child_->AsyncExportModelMetadata(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportModelMetadataRequest const& request) { + return child_->ExportModelMetadata(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> AMLLogging::AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& + request) { + return child_->AsyncDeleteModel(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteModelRequest const& + request) { + return child_->DeleteModel(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) { + return child_->ListEngineConfigs(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + return child_->GetEngineConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + return child_->AsyncCreateEngineConfig(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + return child_->CreateEngineConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + return child_->AsyncUpdateEngineConfig(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + return child_->UpdateEngineConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + return child_->AsyncExportEngineConfigMetadata( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + return child_->ExportEngineConfigMetadata(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + return child_->AsyncDeleteEngineConfig(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + return child_->DeleteEngineConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + return child_->GetEngineVersion(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) { + return child_->ListEngineVersions(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ListPredictionResultsRequest const& request) { + return child_->ListPredictionResults(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + GetPredictionResultRequest const& request) { + return child_->GetPredictionResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + CreatePredictionResultRequest const& request) { + return child_->AsyncCreatePredictionResult(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + CreatePredictionResultRequest const& request) { + return child_->CreatePredictionResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const& request) { + return child_->AsyncUpdatePredictionResult(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const& request) { + return child_->UpdatePredictionResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + return child_->AsyncExportPredictionResultMetadata( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AMLLogging::ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + return child_->ExportPredictionResultMetadata(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + DeletePredictionResultRequest const& request) { + return child_->AsyncDeletePredictionResult(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + DeletePredictionResultRequest const& request) { + return child_->DeletePredictionResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ListBacktestResultsRequest const& request) { + return child_->ListBacktestResults(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + return child_->GetBacktestResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + CreateBacktestResultRequest const& request) { + return child_->AsyncCreateBacktestResult(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + CreateBacktestResultRequest const& request) { + return child_->CreateBacktestResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + UpdateBacktestResultRequest const& request) { + return child_->AsyncUpdateBacktestResult(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + UpdateBacktestResultRequest const& request) { + return child_->UpdateBacktestResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + return child_->AsyncExportBacktestResultMetadata( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AMLLogging::ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + return child_->ExportBacktestResultMetadata(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AMLLogging::AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + DeleteBacktestResultRequest const& request) { + return child_->AsyncDeleteBacktestResult(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AMLLogging::DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1:: + DeleteBacktestResultRequest const& request) { + return child_->DeleteBacktestResult(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AMLLogging::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 AMLLogging::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 +AMLLogging::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 AMLLogging::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 AMLLogging::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 AMLLogging::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> AMLLogging::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 AMLLogging::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 financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_logging_decorator.h b/google/cloud/financialservices/v1/internal/aml_logging_decorator.h new file mode 100644 index 0000000000000..c9fe5e3ac72a1 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_logging_decorator.h @@ -0,0 +1,456 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_LOGGING_DECORATOR_H + +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AMLLogging : public AMLStub { + public: + ~AMLLogging() override = default; + AMLLogging(std::shared_ptr child, TracingOptions tracing_options, + std::set const& components); + + StatusOr + ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) + override; + + future> AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + StatusOr CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + future> AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + StatusOr UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + future> AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + StatusOr DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + future> AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + StatusOr ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + future> AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr + ListDatasets(grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) override; + + StatusOr GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) + override; + + future> AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + StatusOr CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + future> AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + StatusOr UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + future> AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) + override; + + StatusOr GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) + override; + + future> AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + StatusOr CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + future> AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + StatusOr UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + future> AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + StatusOr ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + future> AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr + ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) override; + + StatusOr GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) override; + + future> AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + StatusOr CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + future> AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + StatusOr UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + future> + AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + StatusOr ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + future> AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr + GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) override; + + StatusOr + ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) override; + + StatusOr + ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) override; + + StatusOr + GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) override; + + future> AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + StatusOr CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + future> AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + StatusOr UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + future> + AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + StatusOr ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + future> AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr + ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) override; + + StatusOr + GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) override; + + future> AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + StatusOr CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + future> AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + StatusOr UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + future> + AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + StatusOr ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + future> AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // AMLLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_LOGGING_DECORATOR_H diff --git a/google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc new file mode 100644 index 0000000000000..8fe9c2a109d5d --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc @@ -0,0 +1,806 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_metadata_decorator.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AMLMetadata::AMLMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header) + : child_(std::move(child)), + fixed_metadata_(std::move(fixed_metadata)), + api_client_header_( + api_client_header.empty() + ? google::cloud::internal::GeneratedLibClientHeader() + : std::move(api_client_header)) {} + +StatusOr +AMLMetadata::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListInstances(context, options, request); +} + +StatusOr +AMLMetadata::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetInstance(context, options, request); +} + +future> +AMLMetadata::AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateInstance(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateInstance(context, options, request); +} + +future> +AMLMetadata::AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("instance.name=", + internal::UrlEncode(request.instance().name()))); + return child_->AsyncUpdateInstance(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("instance.name=", + internal::UrlEncode(request.instance().name()))); + return child_->UpdateInstance(context, options, request); +} + +future> +AMLMetadata::AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteInstance(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteInstance(context, options, request); +} + +future> +AMLMetadata::AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncImportRegisteredParties(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ImportRegisteredParties(context, options, request); +} + +future> +AMLMetadata::AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncExportRegisteredParties(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ExportRegisteredParties(context, options, request); +} + +StatusOr +AMLMetadata::ListDatasets( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListDatasets(context, options, request); +} + +StatusOr AMLMetadata::GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetDataset(context, options, request); +} + +future> +AMLMetadata::AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateDataset(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateDataset(context, options, request); +} + +future> +AMLMetadata::AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("dataset.name=", + internal::UrlEncode(request.dataset().name()))); + return child_->AsyncUpdateDataset(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("dataset.name=", + internal::UrlEncode(request.dataset().name()))); + return child_->UpdateDataset(context, options, request); +} + +future> +AMLMetadata::AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteDataset(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteDataset(context, options, request); +} + +StatusOr +AMLMetadata::ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListModels(context, options, request); +} + +StatusOr AMLMetadata::GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetModel(context, options, request); +} + +future> AMLMetadata::AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateModel(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateModel(context, options, request); +} + +future> AMLMetadata::AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("model.name=", internal::UrlEncode(request.model().name()))); + return child_->AsyncUpdateModel(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("model.name=", internal::UrlEncode(request.model().name()))); + return child_->UpdateModel(context, options, request); +} + +future> +AMLMetadata::AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("model=", internal::UrlEncode(request.model()))); + return child_->AsyncExportModelMetadata(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("model=", internal::UrlEncode(request.model()))); + return child_->ExportModelMetadata(context, options, request); +} + +future> AMLMetadata::AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteModel(cq, std::move(context), std::move(options), + request); +} + +StatusOr AMLMetadata::DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteModel(context, options, request); +} + +StatusOr +AMLMetadata::ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListEngineConfigs(context, options, request); +} + +StatusOr +AMLMetadata::GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetEngineConfig(context, options, request); +} + +future> +AMLMetadata::AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateEngineConfig(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateEngineConfig(context, options, request); +} + +future> +AMLMetadata::AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + SetMetadata( + *context, *options, + absl::StrCat("engine_config.name=", + internal::UrlEncode(request.engine_config().name()))); + return child_->AsyncUpdateEngineConfig(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("engine_config.name=", + internal::UrlEncode(request.engine_config().name()))); + return child_->UpdateEngineConfig(context, options, request); +} + +future> +AMLMetadata::AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("engine_config=", + internal::UrlEncode(request.engine_config()))); + return child_->AsyncExportEngineConfigMetadata(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AMLMetadata::ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + SetMetadata(context, options, + absl::StrCat("engine_config=", + internal::UrlEncode(request.engine_config()))); + return child_->ExportEngineConfigMetadata(context, options, request); +} + +future> +AMLMetadata::AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteEngineConfig(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteEngineConfig(context, options, request); +} + +StatusOr +AMLMetadata::GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetEngineVersion(context, options, request); +} + +StatusOr +AMLMetadata::ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListEngineVersions(context, options, request); +} + +StatusOr +AMLMetadata::ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListPredictionResults(context, options, request); +} + +StatusOr +AMLMetadata::GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetPredictionResult(context, options, request); +} + +future> +AMLMetadata::AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreatePredictionResult(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreatePredictionResult(context, options, request); +} + +future> +AMLMetadata::AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + SetMetadata( + *context, *options, + absl::StrCat("prediction_result.name=", + internal::UrlEncode(request.prediction_result().name()))); + return child_->AsyncUpdatePredictionResult(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("prediction_result.name=", + internal::UrlEncode(request.prediction_result().name()))); + return child_->UpdatePredictionResult(context, options, request); +} + +future> +AMLMetadata::AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("prediction_result=", + internal::UrlEncode(request.prediction_result()))); + return child_->AsyncExportPredictionResultMetadata( + cq, std::move(context), std::move(options), request); +} + +StatusOr +AMLMetadata::ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + SetMetadata(context, options, + absl::StrCat("prediction_result=", + internal::UrlEncode(request.prediction_result()))); + return child_->ExportPredictionResultMetadata(context, options, request); +} + +future> +AMLMetadata::AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeletePredictionResult(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeletePredictionResult(context, options, request); +} + +StatusOr +AMLMetadata::ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListBacktestResults(context, options, request); +} + +StatusOr +AMLMetadata::GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetBacktestResult(context, options, request); +} + +future> +AMLMetadata::AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateBacktestResult(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateBacktestResult(context, options, request); +} + +future> +AMLMetadata::AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + SetMetadata( + *context, *options, + absl::StrCat("backtest_result.name=", + internal::UrlEncode(request.backtest_result().name()))); + return child_->AsyncUpdateBacktestResult(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("backtest_result.name=", + internal::UrlEncode(request.backtest_result().name()))); + return child_->UpdateBacktestResult(context, options, request); +} + +future> +AMLMetadata::AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("backtest_result=", + internal::UrlEncode(request.backtest_result()))); + return child_->AsyncExportBacktestResultMetadata(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AMLMetadata::ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + SetMetadata(context, options, + absl::StrCat("backtest_result=", + internal::UrlEncode(request.backtest_result()))); + return child_->ExportBacktestResultMetadata(context, options, request); +} + +future> +AMLMetadata::AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteBacktestResult(cq, std::move(context), + std::move(options), request); +} + +StatusOr AMLMetadata::DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteBacktestResult(context, options, request); +} + +StatusOr +AMLMetadata::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 AMLMetadata::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 +AMLMetadata::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 AMLMetadata::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 AMLMetadata::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 AMLMetadata::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> AMLMetadata::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 AMLMetadata::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 AMLMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void AMLMetadata::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 financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_metadata_decorator.h b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.h new file mode 100644 index 0000000000000..55f09f85019ff --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_metadata_decorator.h @@ -0,0 +1,462 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_METADATA_DECORATOR_H + +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AMLMetadata : public AMLStub { + public: + ~AMLMetadata() override = default; + AMLMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) + override; + + future> AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + StatusOr CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + future> AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + StatusOr UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + future> AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + StatusOr DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + future> AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + StatusOr ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + future> AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr + ListDatasets(grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) override; + + StatusOr GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) + override; + + future> AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + StatusOr CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + future> AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + StatusOr UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + future> AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) + override; + + StatusOr GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) + override; + + future> AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + StatusOr CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + future> AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + StatusOr UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + future> AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + StatusOr ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + future> AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr + ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) override; + + StatusOr GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) override; + + future> AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + StatusOr CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + future> AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + StatusOr UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + future> + AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + StatusOr ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + future> AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr + GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) override; + + StatusOr + ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) override; + + StatusOr + ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) override; + + StatusOr + GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) override; + + future> AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + StatusOr CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + future> AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + StatusOr UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + future> + AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + StatusOr ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + future> AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr + ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) override; + + StatusOr + GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) override; + + future> AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + StatusOr CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + future> AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + StatusOr UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + future> + AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + StatusOr ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + future> AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + void SetMetadata(grpc::ClientContext& context, Options const& options, + std::string const& request_params); + void SetMetadata(grpc::ClientContext& context, Options const& options); + + std::shared_ptr child_; + std::multimap fixed_metadata_; + std::string api_client_header_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_METADATA_DECORATOR_H diff --git a/google/cloud/financialservices/v1/internal/aml_option_defaults.cc b/google/cloud/financialservices/v1/internal/aml_option_defaults.cc new file mode 100644 index 0000000000000..26f205cf64dc2 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_option_defaults.cc @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_option_defaults.h" +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/financialservices/v1/aml_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 financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options AMLDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_AML_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_AML_AUTHORITY", "financialservices.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + financialservices_v1::AMLLimitedTimeRetryPolicy( + std::chrono::minutes(30)) + .clone()); + } + if (!options.has()) { + options.set( + ExponentialBackoffPolicy( + std::chrono::seconds(0), std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) + .clone()); + } + if (!options.has()) { + options.set( + GenericPollingPolicy< + financialservices_v1::AMLRetryPolicyOption::Type, + financialservices_v1::AMLBackoffPolicyOption::Type>( + options.get()->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options + .has()) { + options.set( + financialservices_v1::MakeDefaultAMLConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_option_defaults.h b/google/cloud/financialservices/v1/internal/aml_option_defaults.h new file mode 100644 index 0000000000000..67d9440d1996e --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options AMLDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_OPTION_DEFAULTS_H diff --git a/google/cloud/financialservices/v1/internal/aml_retry_traits.h b/google/cloud/financialservices/v1/internal/aml_retry_traits.h new file mode 100644 index 0000000000000..6343e4d73a0a1 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct AMLRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_RETRY_TRAITS_H diff --git a/google/cloud/financialservices/v1/internal/aml_sources.cc b/google/cloud/financialservices/v1/internal/aml_sources.cc new file mode 100644 index 0000000000000..a70a5c1c96052 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/financialservices/v1/aml_client.cc" +#include "google/cloud/financialservices/v1/aml_connection.cc" +#include "google/cloud/financialservices/v1/aml_connection_idempotency_policy.cc" +#include "google/cloud/financialservices/v1/internal/aml_auth_decorator.cc" +#include "google/cloud/financialservices/v1/internal/aml_connection_impl.cc" +#include "google/cloud/financialservices/v1/internal/aml_logging_decorator.cc" +#include "google/cloud/financialservices/v1/internal/aml_metadata_decorator.cc" +#include "google/cloud/financialservices/v1/internal/aml_option_defaults.cc" +#include "google/cloud/financialservices/v1/internal/aml_stub.cc" +#include "google/cloud/financialservices/v1/internal/aml_stub_factory.cc" +#include "google/cloud/financialservices/v1/internal/aml_tracing_connection.cc" +#include "google/cloud/financialservices/v1/internal/aml_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/financialservices/v1/internal/aml_stub.cc b/google/cloud/financialservices/v1/internal/aml_stub.cc new file mode 100644 index 0000000000000..6e1cfed90b4e0 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_stub.cc @@ -0,0 +1,1094 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AMLStub::~AMLStub() = default; + +StatusOr +DefaultAMLStub::ListInstances( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::ListInstancesRequest const& request) { + google::cloud::financialservices::v1::ListInstancesResponse response; + auto status = grpc_stub_->ListInstances(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::GetInstance( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::GetInstanceRequest const& request) { + google::cloud::financialservices::v1::Instance response; + auto status = grpc_stub_->GetInstance(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::CreateInstanceRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateInstance(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::CreateInstance( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateInstance(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::UpdateInstanceRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateInstance(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::UpdateInstance( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateInstance(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::DeleteInstanceRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteInstance(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::DeleteInstance( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteInstance(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncImportRegisteredParties(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAMLStub::ImportRegisteredParties( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->ImportRegisteredParties(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncExportRegisteredParties(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAMLStub::ExportRegisteredParties( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->ExportRegisteredParties(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::ListDatasets( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::ListDatasetsRequest const& request) { + google::cloud::financialservices::v1::ListDatasetsResponse response; + auto status = grpc_stub_->ListDatasets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::GetDataset( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::GetDatasetRequest const& request) { + google::cloud::financialservices::v1::Dataset response; + auto status = grpc_stub_->GetDataset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::CreateDatasetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateDataset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::CreateDataset( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateDataset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::UpdateDatasetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateDataset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::UpdateDataset( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateDataset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::DeleteDatasetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteDataset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::DeleteDataset( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteDataset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::ListModels( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::ListModelsRequest const& request) { + google::cloud::financialservices::v1::ListModelsResponse response; + auto status = grpc_stub_->ListModels(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAMLStub::GetModel( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::GetModelRequest const& request) { + google::cloud::financialservices::v1::Model response; + auto status = grpc_stub_->GetModel(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::CreateModelRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::CreateModelRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateModel(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::CreateModel( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateModel(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::UpdateModelRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::UpdateModelRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateModel(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::UpdateModel( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateModel(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::ExportModelMetadataRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + ExportModelMetadataRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncExportModelMetadata(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::ExportModelMetadata( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->ExportModelMetadata(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::DeleteModelRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1::DeleteModelRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteModel(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::DeleteModel( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteModel(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::ListEngineConfigs( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) { + google::cloud::financialservices::v1::ListEngineConfigsResponse response; + auto status = grpc_stub_->ListEngineConfigs(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::GetEngineConfig( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + google::cloud::financialservices::v1::EngineConfig response; + auto status = grpc_stub_->GetEngineConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::CreateEngineConfigRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateEngineConfig(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::CreateEngineConfig( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateEngineConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::UpdateEngineConfigRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateEngineConfig(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::UpdateEngineConfig( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateEngineConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::ExportEngineConfigMetadataRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncExportEngineConfigMetadata(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAMLStub::ExportEngineConfigMetadata( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->ExportEngineConfigMetadata(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::DeleteEngineConfigRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteEngineConfig(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::DeleteEngineConfig( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteEngineConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::GetEngineVersion( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + google::cloud::financialservices::v1::EngineVersion response; + auto status = grpc_stub_->GetEngineVersion(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::ListEngineVersions( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) { + google::cloud::financialservices::v1::ListEngineVersionsResponse response; + auto status = grpc_stub_->ListEngineVersions(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::ListPredictionResults( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) { + google::cloud::financialservices::v1::ListPredictionResultsResponse response; + auto status = grpc_stub_->ListPredictionResults(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::GetPredictionResult( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) { + google::cloud::financialservices::v1::PredictionResult response; + auto status = grpc_stub_->GetPredictionResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::CreatePredictionResultRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + CreatePredictionResultRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreatePredictionResult(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::CreatePredictionResult( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreatePredictionResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::UpdatePredictionResultRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdatePredictionResult(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::UpdatePredictionResult( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdatePredictionResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncExportPredictionResultMetadata(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAMLStub::ExportPredictionResultMetadata( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->ExportPredictionResultMetadata(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::DeletePredictionResultRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + DeletePredictionResultRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeletePredictionResult(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::DeletePredictionResult( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeletePredictionResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::ListBacktestResults( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) { + google::cloud::financialservices::v1::ListBacktestResultsResponse response; + auto status = grpc_stub_->ListBacktestResults(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::GetBacktestResult( + grpc::ClientContext& context, Options const&, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + google::cloud::financialservices::v1::BacktestResult response; + auto status = grpc_stub_->GetBacktestResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::CreateBacktestResultRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + CreateBacktestResultRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateBacktestResult(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::CreateBacktestResult( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateBacktestResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::UpdateBacktestResultRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + UpdateBacktestResultRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateBacktestResult(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::UpdateBacktestResult( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateBacktestResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::ExportBacktestResultMetadataRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncExportBacktestResultMetadata(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAMLStub::ExportBacktestResultMetadata( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->ExportBacktestResultMetadata(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAMLStub::AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::financialservices::v1::DeleteBacktestResultRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::financialservices::v1:: + DeleteBacktestResultRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteBacktestResult(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAMLStub::DeleteBacktestResult( + grpc::ClientContext& context, Options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteBacktestResult(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAMLStub::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 DefaultAMLStub::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 +DefaultAMLStub::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 DefaultAMLStub::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 DefaultAMLStub::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 DefaultAMLStub::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> +DefaultAMLStub::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 DefaultAMLStub::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 financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_stub.h b/google/cloud/financialservices/v1/internal/aml_stub.h new file mode 100644 index 0000000000000..5af27c9421f2c --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_stub.h @@ -0,0 +1,898 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_H + +#include "google/cloud/completion_queue.h" +#include "google/cloud/future.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AMLStub { + public: + virtual ~AMLStub() = 0; + + virtual StatusOr + ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& + request) = 0; + + virtual StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& + request) = 0; + + virtual future> AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) = 0; + + virtual StatusOr CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) = 0; + + virtual future> AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) = 0; + + virtual StatusOr UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) = 0; + + virtual future> AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) = 0; + + virtual StatusOr DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) = 0; + + virtual future> + AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) = 0; + + virtual StatusOr ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) = 0; + + virtual future> + AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) = 0; + + virtual StatusOr ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) = 0; + + virtual StatusOr + ListDatasets(grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) = 0; + + virtual StatusOr GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& + request) = 0; + + virtual future> AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request) = 0; + + virtual StatusOr CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request) = 0; + + virtual future> AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request) = 0; + + virtual StatusOr UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request) = 0; + + virtual future> AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request) = 0; + + virtual StatusOr DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request) = 0; + + virtual StatusOr + ListModels(grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& + request) = 0; + + virtual StatusOr GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) = 0; + + virtual future> AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& + request) = 0; + + virtual StatusOr CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& + request) = 0; + + virtual future> AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& + request) = 0; + + virtual StatusOr UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& + request) = 0; + + virtual future> + AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) = 0; + + virtual StatusOr ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) = 0; + + virtual future> AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& + request) = 0; + + virtual StatusOr DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::financialservices::v1::ListEngineConfigsResponse> + ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) = 0; + + virtual StatusOr + GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) = 0; + + virtual future> + AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) = 0; + + virtual StatusOr CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) = 0; + + virtual future> + AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) = 0; + + virtual StatusOr UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) = 0; + + virtual future> + AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) = 0; + + virtual StatusOr ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) = 0; + + virtual future> + AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) = 0; + + virtual StatusOr DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) = 0; + + virtual StatusOr + GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::financialservices::v1::ListEngineVersionsResponse> + ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::financialservices::v1::ListPredictionResultsResponse> + ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) = 0; + + virtual StatusOr + GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) = 0; + + virtual future> + AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) = 0; + + virtual StatusOr CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) = 0; + + virtual future> + AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) = 0; + + virtual StatusOr UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) = 0; + + virtual future> + AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) = 0; + + virtual StatusOr + ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) = 0; + + virtual future> + AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) = 0; + + virtual StatusOr DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::financialservices::v1::ListBacktestResultsResponse> + ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) = 0; + + virtual StatusOr + GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) = 0; + + virtual future> + AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) = 0; + + virtual StatusOr CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) = 0; + + virtual future> + AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) = 0; + + virtual StatusOr UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) = 0; + + virtual future> + AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) = 0; + + virtual StatusOr ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) = 0; + + virtual future> + AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) = 0; + + virtual StatusOr DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) = 0; + + virtual StatusOr + ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) = 0; + + virtual StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) = 0; + + virtual StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) = 0; + + virtual StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) = 0; + + virtual Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) = 0; + + virtual Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) = 0; + + virtual future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) = 0; + + virtual future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) = 0; +}; + +class DefaultAMLStub : public AMLStub { + public: + DefaultAMLStub( + std::unique_ptr + grpc_stub, + std::unique_ptr + locations_stub, + std::unique_ptr + operations_stub) + : grpc_stub_(std::move(grpc_stub)), + locations_stub_(std::move(locations_stub)), + operations_stub_(std::move(operations_stub)) {} + + StatusOr + ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) + override; + + future> AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + StatusOr CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + future> AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + StatusOr UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + future> AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + StatusOr DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + future> AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + StatusOr ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + future> AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr + ListDatasets(grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) override; + + StatusOr GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) + override; + + future> AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + StatusOr CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + future> AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + StatusOr UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + future> AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) + override; + + StatusOr GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) + override; + + future> AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + StatusOr CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + future> AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + StatusOr UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + future> AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + StatusOr ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + future> AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr + ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) override; + + StatusOr GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) override; + + future> AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + StatusOr CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + future> AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + StatusOr UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + future> + AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + StatusOr ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + future> AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr + GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) override; + + StatusOr + ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) override; + + StatusOr + ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) override; + + StatusOr + GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) override; + + future> AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + StatusOr CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + future> AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + StatusOr UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + future> + AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + StatusOr ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + future> AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr + ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) override; + + StatusOr + GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) override; + + future> AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + StatusOr CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + future> AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + StatusOr UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + future> + AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + StatusOr ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + future> AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::unique_ptr + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_H diff --git a/google/cloud/financialservices/v1/internal/aml_stub_factory.cc b/google/cloud/financialservices/v1/internal/aml_stub_factory.cc new file mode 100644 index 0000000000000..961859ed78580 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_stub_factory.cc @@ -0,0 +1,75 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_stub_factory.h" +#include "google/cloud/financialservices/v1/internal/aml_auth_decorator.h" +#include "google/cloud/financialservices/v1/internal/aml_logging_decorator.h" +#include "google/cloud/financialservices/v1/internal/aml_metadata_decorator.h" +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/financialservices/v1/internal/aml_tracing_stub.h" +#include "google/cloud/common_options.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/algorithm.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/log.h" +#include "google/cloud/options.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultAMLStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::financialservices::v1::AML::NewStub(channel); + auto service_locations_stub = + google::cloud::location::Locations::NewStub(channel); + std::shared_ptr stub = std::make_shared( + std::move(service_grpc_stub), std::move(service_locations_stub), + google::longrunning::Operations::NewStub(channel)); + + if (auth->RequiresConfigureContext()) { + stub = std::make_shared(std::move(auth), std::move(stub)); + } + stub = std::make_shared( + std::move(stub), std::multimap{}); + if (internal::Contains(options.get(), "rpc")) { + GCP_LOG(INFO) << "Enabled logging for gRPC calls"; + stub = std::make_shared(std::move(stub), + options.get(), + options.get()); + } + if (internal::TracingEnabled(options)) { + stub = MakeAMLTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_stub_factory.h b/google/cloud/financialservices/v1/internal/aml_stub_factory.h new file mode 100644 index 0000000000000..7113c032050f7 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_stub_factory.h @@ -0,0 +1,42 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_FACTORY_H + +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultAMLStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_STUB_FACTORY_H diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_connection.cc b/google/cloud/financialservices/v1/internal/aml_tracing_connection.cc new file mode 100644 index 0000000000000..572faf72bce34 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_tracing_connection.cc @@ -0,0 +1,1013 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +AMLTracingConnection::AMLTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +AMLTracingConnection::ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::ListInstances"); + internal::OTelScope scope(span); + auto sr = child_->ListInstances(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::financialservices::v1::Instance>(std::move(span), + std::move(sr)); +} + +StatusOr +AMLTracingConnection::GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::GetInstance"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetInstance(request)); +} + +future> +AMLTracingConnection::CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateInstance"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateInstance(request)); +} + +StatusOr AMLTracingConnection::CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateInstance"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateInstance(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::CreateInstance( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateInstance"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateInstance(operation)); +} + +future> +AMLTracingConnection::UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateInstance"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateInstance(request)); +} + +StatusOr AMLTracingConnection::UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateInstance"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateInstance(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::UpdateInstance( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateInstance"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateInstance(operation)); +} + +future> +AMLTracingConnection::DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteInstance"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteInstance(request)); +} + +StatusOr AMLTracingConnection::DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteInstance"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteInstance(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::DeleteInstance( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteInstance"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteInstance(operation)); +} + +future> +AMLTracingConnection::ImportRegisteredParties( + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ImportRegisteredParties"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ImportRegisteredParties(request)); +} + +StatusOr +AMLTracingConnection::ImportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ImportRegisteredParties"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->ImportRegisteredParties(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::ImportRegisteredParties( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ImportRegisteredParties"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ImportRegisteredParties(operation)); +} + +future> +AMLTracingConnection::ExportRegisteredParties( + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportRegisteredParties"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportRegisteredParties(request)); +} + +StatusOr +AMLTracingConnection::ExportRegisteredParties( + NoAwaitTag, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportRegisteredParties"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->ExportRegisteredParties(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::ExportRegisteredParties( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportRegisteredParties"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportRegisteredParties(operation)); +} + +StreamRange +AMLTracingConnection::ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::ListDatasets"); + internal::OTelScope scope(span); + auto sr = child_->ListDatasets(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::financialservices::v1::Dataset>(std::move(span), + std::move(sr)); +} + +StatusOr +AMLTracingConnection::GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::GetDataset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetDataset(request)); +} + +future> +AMLTracingConnection::CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateDataset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateDataset(request)); +} + +StatusOr AMLTracingConnection::CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateDataset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateDataset(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::CreateDataset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateDataset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateDataset(operation)); +} + +future> +AMLTracingConnection::UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateDataset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateDataset(request)); +} + +StatusOr AMLTracingConnection::UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateDataset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateDataset(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::UpdateDataset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateDataset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateDataset(operation)); +} + +future> +AMLTracingConnection::DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteDataset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteDataset(request)); +} + +StatusOr AMLTracingConnection::DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteDataset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteDataset(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::DeleteDataset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteDataset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteDataset(operation)); +} + +StreamRange +AMLTracingConnection::ListModels( + google::cloud::financialservices::v1::ListModelsRequest request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::ListModels"); + internal::OTelScope scope(span); + auto sr = child_->ListModels(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::financialservices::v1::Model>(std::move(span), + std::move(sr)); +} + +StatusOr +AMLTracingConnection::GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::GetModel"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetModel(request)); +} + +future> +AMLTracingConnection::CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateModel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateModel(request)); +} + +StatusOr AMLTracingConnection::CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateModel"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateModel(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::CreateModel( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::CreateModel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateModel(operation)); +} + +future> +AMLTracingConnection::UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateModel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateModel(request)); +} + +StatusOr AMLTracingConnection::UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateModel"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateModel(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::UpdateModel( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::UpdateModel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateModel(operation)); +} + +future< + StatusOr> +AMLTracingConnection::ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportModelMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportModelMetadata(request)); +} + +StatusOr +AMLTracingConnection::ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportModelMetadata"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->ExportModelMetadata(NoAwaitTag{}, request)); +} + +future< + StatusOr> +AMLTracingConnection::ExportModelMetadata( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportModelMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportModelMetadata(operation)); +} + +future> +AMLTracingConnection::DeleteModel( + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteModel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteModel(request)); +} + +StatusOr AMLTracingConnection::DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteModel"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteModel(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::DeleteModel( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::DeleteModel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteModel(operation)); +} + +StreamRange +AMLTracingConnection::ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ListEngineConfigs"); + internal::OTelScope scope(span); + auto sr = child_->ListEngineConfigs(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::financialservices::v1::EngineConfig>(std::move(span), + std::move(sr)); +} + +StatusOr +AMLTracingConnection::GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::GetEngineConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetEngineConfig(request)); +} + +future> +AMLTracingConnection::CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreateEngineConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateEngineConfig(request)); +} + +StatusOr +AMLTracingConnection::CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreateEngineConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateEngineConfig(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::CreateEngineConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreateEngineConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateEngineConfig(operation)); +} + +future> +AMLTracingConnection::UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdateEngineConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateEngineConfig(request)); +} + +StatusOr +AMLTracingConnection::UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdateEngineConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateEngineConfig(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::UpdateEngineConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdateEngineConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateEngineConfig(operation)); +} + +future> +AMLTracingConnection::ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportEngineConfigMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportEngineConfigMetadata(request)); +} + +StatusOr +AMLTracingConnection::ExportEngineConfigMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportEngineConfigMetadata"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->ExportEngineConfigMetadata(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::ExportEngineConfigMetadata( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportEngineConfigMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportEngineConfigMetadata(operation)); +} + +future> +AMLTracingConnection::DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeleteEngineConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteEngineConfig(request)); +} + +StatusOr +AMLTracingConnection::DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeleteEngineConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteEngineConfig(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::DeleteEngineConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeleteEngineConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteEngineConfig(operation)); +} + +StatusOr +AMLTracingConnection::GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::GetEngineVersion"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetEngineVersion(request)); +} + +StreamRange +AMLTracingConnection::ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ListEngineVersions"); + internal::OTelScope scope(span); + auto sr = child_->ListEngineVersions(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::financialservices::v1::EngineVersion>(std::move(span), + std::move(sr)); +} + +StreamRange +AMLTracingConnection::ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ListPredictionResults"); + internal::OTelScope scope(span); + auto sr = child_->ListPredictionResults(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::financialservices::v1::PredictionResult>(std::move(span), + std::move(sr)); +} + +StatusOr +AMLTracingConnection::GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::GetPredictionResult"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetPredictionResult(request)); +} + +future> +AMLTracingConnection::CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreatePredictionResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreatePredictionResult(request)); +} + +StatusOr +AMLTracingConnection::CreatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreatePredictionResult"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreatePredictionResult(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::CreatePredictionResult( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreatePredictionResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreatePredictionResult(operation)); +} + +future> +AMLTracingConnection::UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdatePredictionResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdatePredictionResult(request)); +} + +StatusOr +AMLTracingConnection::UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdatePredictionResult"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdatePredictionResult(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::UpdatePredictionResult( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdatePredictionResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdatePredictionResult(operation)); +} + +future> +AMLTracingConnection::ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportPredictionResultMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportPredictionResultMetadata(request)); +} + +StatusOr +AMLTracingConnection::ExportPredictionResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportPredictionResultMetadata"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->ExportPredictionResultMetadata(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::ExportPredictionResultMetadata( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportPredictionResultMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportPredictionResultMetadata(operation)); +} + +future> +AMLTracingConnection::DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeletePredictionResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeletePredictionResult(request)); +} + +StatusOr +AMLTracingConnection::DeletePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeletePredictionResult"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeletePredictionResult(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::DeletePredictionResult( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeletePredictionResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeletePredictionResult(operation)); +} + +StreamRange +AMLTracingConnection::ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ListBacktestResults"); + internal::OTelScope scope(span); + auto sr = child_->ListBacktestResults(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::financialservices::v1::BacktestResult>(std::move(span), + std::move(sr)); +} + +StatusOr +AMLTracingConnection::GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::GetBacktestResult"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetBacktestResult(request)); +} + +future> +AMLTracingConnection::CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreateBacktestResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateBacktestResult(request)); +} + +StatusOr +AMLTracingConnection::CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreateBacktestResult"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateBacktestResult(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::CreateBacktestResult( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CreateBacktestResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateBacktestResult(operation)); +} + +future> +AMLTracingConnection::UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdateBacktestResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateBacktestResult(request)); +} + +StatusOr +AMLTracingConnection::UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdateBacktestResult"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateBacktestResult(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::UpdateBacktestResult( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::UpdateBacktestResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateBacktestResult(operation)); +} + +future> +AMLTracingConnection::ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportBacktestResultMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportBacktestResultMetadata(request)); +} + +StatusOr +AMLTracingConnection::ExportBacktestResultMetadata( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportBacktestResultMetadata"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->ExportBacktestResultMetadata(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::ExportBacktestResultMetadata( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::ExportBacktestResultMetadata"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportBacktestResultMetadata(operation)); +} + +future> +AMLTracingConnection::DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeleteBacktestResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteBacktestResult(request)); +} + +StatusOr +AMLTracingConnection::DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeleteBacktestResult"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteBacktestResult(NoAwaitTag{}, request)); +} + +future> +AMLTracingConnection::DeleteBacktestResult( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeleteBacktestResult"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteBacktestResult(operation)); +} + +StreamRange +AMLTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr AMLTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +AMLTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr AMLTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("financialservices_v1::AMLConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status AMLTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status AMLTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "financialservices_v1::AMLConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +std::shared_ptr MakeAMLTracingConnection( + std::shared_ptr conn) { +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_connection.h b/google/cloud/financialservices/v1/internal/aml_tracing_connection.h new file mode 100644 index 0000000000000..a9c678ff98acb --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_tracing_connection.h @@ -0,0 +1,470 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_TRACING_CONNECTION_H + +#include "google/cloud/financialservices/v1/aml_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +class AMLTracingConnection : public financialservices_v1::AMLConnection { + public: + ~AMLTracingConnection() override = default; + + explicit AMLTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange ListInstances( + google::cloud::financialservices::v1::ListInstancesRequest request) + override; + + StatusOr GetInstance( + google::cloud::financialservices::v1::GetInstanceRequest const& request) + override; + + future> + CreateInstance( + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + StatusOr CreateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + future> + CreateInstance(google::longrunning::Operation const& operation) override; + + future> + UpdateInstance( + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + StatusOr UpdateInstance( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + future> + UpdateInstance(google::longrunning::Operation const& operation) override; + + future> + DeleteInstance( + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + StatusOr DeleteInstance( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + future> + DeleteInstance(google::longrunning::Operation const& operation) override; + + future> + ImportRegisteredParties( + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + StatusOr ImportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + future> + ImportRegisteredParties( + google::longrunning::Operation const& operation) override; + + future> + ExportRegisteredParties( + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr ExportRegisteredParties( + NoAwaitTag, google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + future> + ExportRegisteredParties( + google::longrunning::Operation const& operation) override; + + StreamRange ListDatasets( + google::cloud::financialservices::v1::ListDatasetsRequest request) + override; + + StatusOr GetDataset( + google::cloud::financialservices::v1::GetDatasetRequest const& request) + override; + + future> CreateDataset( + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + StatusOr CreateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + future> CreateDataset( + google::longrunning::Operation const& operation) override; + + future> UpdateDataset( + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + StatusOr UpdateDataset( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + future> UpdateDataset( + google::longrunning::Operation const& operation) override; + + future> + DeleteDataset( + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr DeleteDataset( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + future> + DeleteDataset(google::longrunning::Operation const& operation) override; + + StreamRange ListModels( + google::cloud::financialservices::v1::ListModelsRequest request) override; + + StatusOr GetModel( + google::cloud::financialservices::v1::GetModelRequest const& request) + override; + + future> CreateModel( + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + StatusOr CreateModel( + NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + future> CreateModel( + google::longrunning::Operation const& operation) override; + + future> UpdateModel( + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + StatusOr UpdateModel( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + future> UpdateModel( + google::longrunning::Operation const& operation) override; + + future> + ExportModelMetadata( + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + StatusOr ExportModelMetadata( + NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + future> + ExportModelMetadata(google::longrunning::Operation const& operation) override; + + future> + DeleteModel(google::cloud::financialservices::v1::DeleteModelRequest const& + request) override; + + StatusOr DeleteModel( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + future> + DeleteModel(google::longrunning::Operation const& operation) override; + + StreamRange + ListEngineConfigs( + google::cloud::financialservices::v1::ListEngineConfigsRequest request) + override; + + StatusOr GetEngineConfig( + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) override; + + future> + CreateEngineConfig( + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + StatusOr CreateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + future> + CreateEngineConfig(google::longrunning::Operation const& operation) override; + + future> + UpdateEngineConfig( + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + StatusOr UpdateEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + future> + UpdateEngineConfig(google::longrunning::Operation const& operation) override; + + future> + ExportEngineConfigMetadata( + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + StatusOr ExportEngineConfigMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + future> + ExportEngineConfigMetadata( + google::longrunning::Operation const& operation) override; + + future> + DeleteEngineConfig( + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr DeleteEngineConfig( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + future> + DeleteEngineConfig(google::longrunning::Operation const& operation) override; + + StatusOr + GetEngineVersion( + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) override; + + StreamRange + ListEngineVersions( + google::cloud::financialservices::v1::ListEngineVersionsRequest request) + override; + + StreamRange + ListPredictionResults( + google::cloud::financialservices::v1::ListPredictionResultsRequest + request) override; + + StatusOr + GetPredictionResult( + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) override; + + future> + CreatePredictionResult( + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + StatusOr CreatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + future> + CreatePredictionResult( + google::longrunning::Operation const& operation) override; + + future> + UpdatePredictionResult( + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + StatusOr UpdatePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + future> + UpdatePredictionResult( + google::longrunning::Operation const& operation) override; + + future> + ExportPredictionResultMetadata( + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + StatusOr ExportPredictionResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + future> + ExportPredictionResultMetadata( + google::longrunning::Operation const& operation) override; + + future> + DeletePredictionResult( + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr DeletePredictionResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + future> + DeletePredictionResult( + google::longrunning::Operation const& operation) override; + + StreamRange + ListBacktestResults( + google::cloud::financialservices::v1::ListBacktestResultsRequest request) + override; + + StatusOr + GetBacktestResult( + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) override; + + future> + CreateBacktestResult( + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + StatusOr CreateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + future> + CreateBacktestResult( + google::longrunning::Operation const& operation) override; + + future> + UpdateBacktestResult( + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + StatusOr UpdateBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + future> + UpdateBacktestResult( + google::longrunning::Operation const& operation) override; + + future> + ExportBacktestResultMetadata( + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + StatusOr ExportBacktestResultMetadata( + NoAwaitTag, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + future> + ExportBacktestResultMetadata( + google::longrunning::Operation const& operation) override; + + future> + DeleteBacktestResult( + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr DeleteBacktestResult( + NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + future> + DeleteBacktestResult( + google::longrunning::Operation const& operation) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request) override; + + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr child_; +}; + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +/** + * Conditionally applies the tracing decorator to the given connection. + * + * The connection is only decorated if tracing is enabled (as determined by the + * connection's options). + */ +std::shared_ptr MakeAMLTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_TRACING_CONNECTION_H diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_stub.cc b/google/cloud/financialservices/v1/internal/aml_tracing_stub.cc new file mode 100644 index 0000000000000..a26d273f122fe --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_tracing_stub.cc @@ -0,0 +1,985 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/internal/aml_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +AMLTracingStub::AMLTracingStub(std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +AMLTracingStub::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListInstances"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListInstances(context, options, request)); +} + +StatusOr +AMLTracingStub::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetInstance"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetInstance(context, options, request)); +} + +future> +AMLTracingStub::AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateInstance"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateInstance(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateInstance"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateInstance(context, options, request)); +} + +future> +AMLTracingStub::AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateInstance"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateInstance(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateInstance"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateInstance(context, options, request)); +} + +future> +AMLTracingStub::AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteInstance"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteInstance(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteInstance"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteInstance(context, options, request)); +} + +future> +AMLTracingStub::AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ImportRegisteredParties"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncImportRegisteredParties(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AMLTracingStub::ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ImportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ImportRegisteredParties"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ImportRegisteredParties(context, options, request)); +} + +future> +AMLTracingStub::AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportRegisteredParties"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncExportRegisteredParties(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AMLTracingStub::ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportRegisteredPartiesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportRegisteredParties"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ExportRegisteredParties(context, options, request)); +} + +StatusOr +AMLTracingStub::ListDatasets( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListDatasets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListDatasets(context, options, request)); +} + +StatusOr +AMLTracingStub::GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetDataset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetDataset(context, options, request)); +} + +future> +AMLTracingStub::AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateDataset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateDataset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateDataset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateDataset(context, options, request)); +} + +future> +AMLTracingStub::AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateDataset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateDataset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateDataset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateDataset(context, options, request)); +} + +future> +AMLTracingStub::AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteDataset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteDataset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteDataset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteDataset(context, options, request)); +} + +StatusOr +AMLTracingStub::ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListModels"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListModels(context, options, request)); +} + +StatusOr AMLTracingStub::GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetModel"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetModel(context, options, request)); +} + +future> +AMLTracingStub::AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateModel"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateModel(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateModel"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateModel(context, options, request)); +} + +future> +AMLTracingStub::AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateModel"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateModel(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateModel"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateModel(context, options, request)); +} + +future> +AMLTracingStub::AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportModelMetadata"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncExportModelMetadata(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportModelMetadata"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ExportModelMetadata(context, options, request)); +} + +future> +AMLTracingStub::AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteModel"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteModel(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteModel"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteModel(context, options, request)); +} + +StatusOr +AMLTracingStub::ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListEngineConfigs"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListEngineConfigs(context, options, request)); +} + +StatusOr +AMLTracingStub::GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetEngineConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetEngineConfig(context, options, request)); +} + +future> +AMLTracingStub::AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateEngineConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateEngineConfig(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateEngineConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateEngineConfig(context, options, request)); +} + +future> +AMLTracingStub::AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateEngineConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateEngineConfig(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateEngineConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateEngineConfig(context, options, request)); +} + +future> +AMLTracingStub::AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportEngineConfigMetadata"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncExportEngineConfigMetadata(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AMLTracingStub::ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportEngineConfigMetadata"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ExportEngineConfigMetadata(context, options, request)); +} + +future> +AMLTracingStub::AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteEngineConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteEngineConfig(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteEngineConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteEngineConfig(context, options, request)); +} + +StatusOr +AMLTracingStub::GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetEngineVersion"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetEngineVersion(context, options, request)); +} + +StatusOr +AMLTracingStub::ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListEngineVersions"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListEngineVersions(context, options, request)); +} + +StatusOr +AMLTracingStub::ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListPredictionResults"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListPredictionResults(context, options, request)); +} + +StatusOr +AMLTracingStub::GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetPredictionResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetPredictionResult(context, options, request)); +} + +future> +AMLTracingStub::AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreatePredictionResult"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreatePredictionResult(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreatePredictionResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreatePredictionResult(context, options, request)); +} + +future> +AMLTracingStub::AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdatePredictionResult"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdatePredictionResult(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdatePredictionResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdatePredictionResult(context, options, request)); +} + +future> +AMLTracingStub::AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportPredictionResultMetadata"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncExportPredictionResultMetadata( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AMLTracingStub::ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportPredictionResultMetadata"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ExportPredictionResultMetadata(context, options, request)); +} + +future> +AMLTracingStub::AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeletePredictionResult"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeletePredictionResult(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeletePredictionResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeletePredictionResult(context, options, request)); +} + +StatusOr +AMLTracingStub::ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListBacktestResults"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListBacktestResults(context, options, request)); +} + +StatusOr +AMLTracingStub::GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetBacktestResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetBacktestResult(context, options, request)); +} + +future> +AMLTracingStub::AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateBacktestResult"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateBacktestResult(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CreateBacktestResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateBacktestResult(context, options, request)); +} + +future> +AMLTracingStub::AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateBacktestResult"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateBacktestResult(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "UpdateBacktestResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateBacktestResult(context, options, request)); +} + +future> +AMLTracingStub::AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportBacktestResultMetadata"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncExportBacktestResultMetadata( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AMLTracingStub::ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ExportBacktestResultMetadata"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ExportBacktestResultMetadata(context, options, request)); +} + +future> +AMLTracingStub::AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteBacktestResult"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteBacktestResult(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AMLTracingStub::DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteBacktestResult"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteBacktestResult(context, options, request)); +} + +StatusOr +AMLTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr AMLTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +AMLTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr AMLTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status AMLTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status AMLTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.financialservices.v1.AML", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +AMLTracingStub::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 AMLTracingStub::AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.longrunning.Operations", + "CancelOperation"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCancelOperation(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +std::shared_ptr MakeAMLTracingStub(std::shared_ptr stub) { +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + return std::make_shared(std::move(stub)); +#else + return stub; +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/financialservices/v1/internal/aml_tracing_stub.h b/google/cloud/financialservices/v1/internal/aml_tracing_stub.h new file mode 100644 index 0000000000000..b50169d3069b1 --- /dev/null +++ b/google/cloud/financialservices/v1/internal/aml_tracing_stub.h @@ -0,0 +1,467 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_TRACING_STUB_H + +#include "google/cloud/financialservices/v1/internal/aml_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +class AMLTracingStub : public AMLStub { + public: + ~AMLTracingStub() override = default; + + explicit AMLTracingStub(std::shared_ptr child); + + StatusOr + ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetInstanceRequest const& request) + override; + + future> AsyncCreateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + StatusOr CreateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request) override; + + future> AsyncUpdateInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + StatusOr UpdateInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request) override; + + future> AsyncDeleteInstance( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + StatusOr DeleteInstance( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request) override; + + future> AsyncImportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + StatusOr ImportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request) override; + + future> AsyncExportRegisteredParties( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr ExportRegisteredParties( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request) override; + + StatusOr + ListDatasets(grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListDatasetsRequest const& + request) override; + + StatusOr GetDataset( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetDatasetRequest const& request) + override; + + future> AsyncCreateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + StatusOr CreateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateDatasetRequest const& request) + override; + + future> AsyncUpdateDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + StatusOr UpdateDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateDatasetRequest const& request) + override; + + future> AsyncDeleteDataset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr DeleteDataset( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteDatasetRequest const& request) + override; + + StatusOr ListModels( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListModelsRequest const& request) + override; + + StatusOr GetModel( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetModelRequest const& request) + override; + + future> AsyncCreateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + StatusOr CreateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateModelRequest const& request) + override; + + future> AsyncUpdateModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + StatusOr UpdateModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateModelRequest const& request) + override; + + future> AsyncExportModelMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + StatusOr ExportModelMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request) override; + + future> AsyncDeleteModel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr DeleteModel( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteModelRequest const& request) + override; + + StatusOr + ListEngineConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineConfigsRequest const& + request) override; + + StatusOr GetEngineConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineConfigRequest const& + request) override; + + future> AsyncCreateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + StatusOr CreateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request) override; + + future> AsyncUpdateEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + StatusOr UpdateEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request) override; + + future> + AsyncExportEngineConfigMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + StatusOr ExportEngineConfigMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request) override; + + future> AsyncDeleteEngineConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr DeleteEngineConfig( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request) override; + + StatusOr + GetEngineVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetEngineVersionRequest const& + request) override; + + StatusOr + ListEngineVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListEngineVersionsRequest const& + request) override; + + StatusOr + ListPredictionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListPredictionResultsRequest const& + request) override; + + StatusOr + GetPredictionResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetPredictionResultRequest const& + request) override; + + future> AsyncCreatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + StatusOr CreatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreatePredictionResultRequest const& + request) override; + + future> AsyncUpdatePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + StatusOr UpdatePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdatePredictionResultRequest const& + request) override; + + future> + AsyncExportPredictionResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + StatusOr ExportPredictionResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request) override; + + future> AsyncDeletePredictionResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr DeletePredictionResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeletePredictionResultRequest const& + request) override; + + StatusOr + ListBacktestResults( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::ListBacktestResultsRequest const& + request) override; + + StatusOr + GetBacktestResult( + grpc::ClientContext& context, Options const& options, + google::cloud::financialservices::v1::GetBacktestResultRequest const& + request) override; + + future> AsyncCreateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + StatusOr CreateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request) override; + + future> AsyncUpdateBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + StatusOr UpdateBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request) override; + + future> + AsyncExportBacktestResultMetadata( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + StatusOr ExportBacktestResultMetadata( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request) override; + + future> AsyncDeleteBacktestResult( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr DeleteBacktestResult( + grpc::ClientContext& context, Options options, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request) override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeAMLTracingStub(std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_INTERNAL_AML_TRACING_STUB_H diff --git a/google/cloud/financialservices/v1/mocks/mock_aml_connection.h b/google/cloud/financialservices/v1/mocks/mock_aml_connection.h new file mode 100644 index 0000000000000..3be54b8b0e88e --- /dev/null +++ b/google/cloud/financialservices/v1/mocks/mock_aml_connection.h @@ -0,0 +1,1152 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_MOCKS_MOCK_AML_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_MOCKS_MOCK_AML_CONNECTION_H + +#include "google/cloud/financialservices/v1/aml_connection.h" +#include + +namespace google { +namespace cloud { +namespace financialservices_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `AMLConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `AMLClient`. To do so, + * construct an object of type `AMLClient` 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 MockAMLConnection : public financialservices_v1::AMLConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD( + (StreamRange), + ListInstances, + (google::cloud::financialservices::v1::ListInstancesRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetInstance, + (google::cloud::financialservices::v1::GetInstanceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateInstance(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateInstance, + (google::cloud::financialservices::v1::CreateInstanceRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateInstance(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateInstance, + (NoAwaitTag, + google::cloud::financialservices::v1::CreateInstanceRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateInstance(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateInstance, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateInstance(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateInstance, + (google::cloud::financialservices::v1::UpdateInstanceRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateInstance(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateInstance, + (NoAwaitTag, + google::cloud::financialservices::v1::UpdateInstanceRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateInstance(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateInstance, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteInstance(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteInstance, + (google::cloud::financialservices::v1::DeleteInstanceRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteInstance(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteInstance, + (NoAwaitTag, + google::cloud::financialservices::v1::DeleteInstanceRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteInstance(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteInstance, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ImportRegisteredParties(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ImportRegisteredParties, + (google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ImportRegisteredParties(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, ImportRegisteredParties, + (NoAwaitTag, google::cloud::financialservices::v1:: + ImportRegisteredPartiesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ImportRegisteredParties(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ImportRegisteredParties, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportRegisteredParties(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportRegisteredParties, + (google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ExportRegisteredParties(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, ExportRegisteredParties, + (NoAwaitTag, google::cloud::financialservices::v1:: + ExportRegisteredPartiesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportRegisteredParties(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportRegisteredParties, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + (StreamRange), + ListDatasets, + (google::cloud::financialservices::v1::ListDatasetsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetDataset, + (google::cloud::financialservices::v1::GetDatasetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateDataset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateDataset, + (google::cloud::financialservices::v1::CreateDatasetRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateDataset(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateDataset, + (NoAwaitTag, + google::cloud::financialservices::v1::CreateDatasetRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateDataset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateDataset, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateDataset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateDataset, + (google::cloud::financialservices::v1::UpdateDatasetRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateDataset(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateDataset, + (NoAwaitTag, + google::cloud::financialservices::v1::UpdateDatasetRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateDataset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateDataset, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteDataset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteDataset, + (google::cloud::financialservices::v1::DeleteDatasetRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteDataset(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteDataset, + (NoAwaitTag, + google::cloud::financialservices::v1::DeleteDatasetRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteDataset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteDataset, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListModels, + (google::cloud::financialservices::v1::ListModelsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetModel, + (google::cloud::financialservices::v1::GetModelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateModel(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateModel, + (google::cloud::financialservices::v1::CreateModelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateModel(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateModel, + (NoAwaitTag, + google::cloud::financialservices::v1::CreateModelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateModel(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateModel, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateModel(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateModel, + (google::cloud::financialservices::v1::UpdateModelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateModel(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateModel, + (NoAwaitTag, + google::cloud::financialservices::v1::UpdateModelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateModel(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateModel, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportModelMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + ExportModelMetadata, + (google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ExportModelMetadata(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, ExportModelMetadata, + (NoAwaitTag, + google::cloud::financialservices::v1::ExportModelMetadataRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportModelMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + ExportModelMetadata, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteModel(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteModel, + (google::cloud::financialservices::v1::DeleteModelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteModel(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteModel, + (NoAwaitTag, + google::cloud::financialservices::v1::DeleteModelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteModel(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteModel, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange), + ListEngineConfigs, + (google::cloud::financialservices::v1::ListEngineConfigsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + GetEngineConfig, + (google::cloud::financialservices::v1::GetEngineConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateEngineConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateEngineConfig, + (google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateEngineConfig(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateEngineConfig, + (NoAwaitTag, + google::cloud::financialservices::v1::CreateEngineConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateEngineConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateEngineConfig, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateEngineConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateEngineConfig, + (google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateEngineConfig(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateEngineConfig, + (NoAwaitTag, + google::cloud::financialservices::v1::UpdateEngineConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateEngineConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateEngineConfig, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportEngineConfigMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportEngineConfigMetadata, + (google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ExportEngineConfigMetadata(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + ExportEngineConfigMetadata, + (NoAwaitTag, + google::cloud::financialservices::v1:: + ExportEngineConfigMetadataRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportEngineConfigMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportEngineConfigMetadata, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteEngineConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteEngineConfig, + (google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteEngineConfig(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteEngineConfig, + (NoAwaitTag, + google::cloud::financialservices::v1::DeleteEngineConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteEngineConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteEngineConfig, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + StatusOr, + GetEngineVersion, + (google::cloud::financialservices::v1::GetEngineVersionRequest const& + request), + (override)); + + MOCK_METHOD( + (StreamRange), + ListEngineVersions, + (google::cloud::financialservices::v1::ListEngineVersionsRequest request), + (override)); + + MOCK_METHOD( + (StreamRange), + ListPredictionResults, + (google::cloud::financialservices::v1::ListPredictionResultsRequest + request), + (override)); + + MOCK_METHOD( + StatusOr, + GetPredictionResult, + (google::cloud::financialservices::v1::GetPredictionResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreatePredictionResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreatePredictionResult, + (google::cloud::financialservices::v1:: + CreatePredictionResultRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreatePredictionResult(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreatePredictionResult, + (NoAwaitTag, google::cloud::financialservices::v1:: + CreatePredictionResultRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreatePredictionResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreatePredictionResult, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdatePredictionResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdatePredictionResult, + (google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdatePredictionResult(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdatePredictionResult, + (NoAwaitTag, google::cloud::financialservices::v1:: + UpdatePredictionResultRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdatePredictionResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdatePredictionResult, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportPredictionResultMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportPredictionResultMetadata, + (google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ExportPredictionResultMetadata(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + ExportPredictionResultMetadata, + (NoAwaitTag, + google::cloud::financialservices::v1:: + ExportPredictionResultMetadataRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportPredictionResultMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportPredictionResultMetadata, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeletePredictionResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeletePredictionResult, + (google::cloud::financialservices::v1:: + DeletePredictionResultRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeletePredictionResult(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeletePredictionResult, + (NoAwaitTag, google::cloud::financialservices::v1:: + DeletePredictionResultRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeletePredictionResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeletePredictionResult, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange), + ListBacktestResults, + (google::cloud::financialservices::v1::ListBacktestResultsRequest + request), + (override)); + + MOCK_METHOD( + StatusOr, + GetBacktestResult, + (google::cloud::financialservices::v1::GetBacktestResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateBacktestResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateBacktestResult, + (google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateBacktestResult(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateBacktestResult, + (NoAwaitTag, + google::cloud::financialservices::v1::CreateBacktestResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateBacktestResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateBacktestResult, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateBacktestResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateBacktestResult, + (google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateBacktestResult(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateBacktestResult, + (NoAwaitTag, + google::cloud::financialservices::v1::UpdateBacktestResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateBacktestResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateBacktestResult, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportBacktestResultMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportBacktestResultMetadata, + (google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ExportBacktestResultMetadata(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + ExportBacktestResultMetadata, + (NoAwaitTag, + google::cloud::financialservices::v1:: + ExportBacktestResultMetadataRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportBacktestResultMetadata(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportBacktestResultMetadata, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteBacktestResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteBacktestResult, + (google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteBacktestResult(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteBacktestResult, + (NoAwaitTag, + google::cloud::financialservices::v1::DeleteBacktestResultRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteBacktestResult(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteBacktestResult, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListLocations, + (google::cloud::location::ListLocationsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetLocation, + (google::cloud::location::GetLocationRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListOperations, + (google::longrunning::ListOperationsRequest request), (override)); + + MOCK_METHOD(StatusOr, GetOperation, + (google::longrunning::GetOperationRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteOperation, + (google::longrunning::DeleteOperationRequest const& request), + (override)); + + MOCK_METHOD(Status, CancelOperation, + (google::longrunning::CancelOperationRequest const& request), + (override)); +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace financialservices_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_FINANCIALSERVICES_V1_MOCKS_MOCK_AML_CONNECTION_H diff --git a/google/cloud/financialservices/v1/samples/aml_client_samples.cc b/google/cloud/financialservices/v1/samples/aml_client_samples.cc new file mode 100644 index 0000000000000..01004b638deff --- /dev/null +++ b/google/cloud/financialservices/v1/samples/aml_client_samples.cc @@ -0,0 +1,202 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/financialservices/v1/service.proto + +#include "google/cloud/financialservices/v1/aml_client.h" +#include "google/cloud/financialservices/v1/aml_connection_idempotency_policy.h" +#include "google/cloud/financialservices/v1/aml_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: financialservices_v1::AMLClient +// 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 client = google::cloud::financialservices_v1::AMLClient( + google::cloud::financialservices_v1::MakeAMLConnection(options)); + //! [set-client-endpoint] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy : public google::cloud::financialservices_v1:: + AMLConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::financialservices_v1::AMLConnectionIdempotencyPolicy> + 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::financialservices_v1:: + AMLLimitedErrorCountRetryPolicy(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::financialservices_v1::MakeAMLConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::financialservices_v1::AMLClient(connection); + auto c2 = google::cloud::financialservices_v1::AMLClient(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::financialservices_v1::AMLClient( + connection, + google::cloud::Options{} + .set( + google::cloud::financialservices_v1::AMLLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::financialservices_v1::AMLLimitedErrorCountRetryPolicy(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::financialservices_v1::AMLRetryPolicyOption:: + Type, + google::cloud::financialservices_v1::AMLBackoffPolicyOption:: + Type>( + google::cloud::financialservices_v1:: + AMLLimitedTimeRetryPolicy( + /*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::financialservices_v1::MakeAMLConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::financialservices_v1::AMLClient(connection); + auto c2 = google::cloud::financialservices_v1::AMLClient(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::financialservices_v1::AMLClient( + google::cloud::financialservices_v1::MakeAMLConnection(options)); + } + //! [with-service-account] + (argv.at(0)); +} + +void AutoRun(std::vector const& argv) { + namespace examples = ::google::cloud::testing_util; + using ::google::cloud::internal::GetEnv; + if (!argv.empty()) throw examples::Usage{"auto"}; + examples::CheckEnvironmentVariablesAreSet( + {"GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE"}); + auto const keyfile = + GetEnv("GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE").value(); + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); + + std::cout << "\nRunning SetRetryPolicy() example" << std::endl; + SetRetryPolicy({}); + + std::cout << "\nRunning SetPollingPolicy() example" << std::endl; + SetPollingPolicy({}); + + std::cout << "\nRunning WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"set-retry-policy", SetRetryPolicy}, + {"set-polling-policy", SetPollingPolicy}, + {"with-service-account", WithServiceAccount}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/libraries.bzl b/libraries.bzl index c6879049a9862..3fc6d6c7f7d21 100644 --- a/libraries.bzl +++ b/libraries.bzl @@ -159,6 +159,7 @@ GOOGLE_CLOUD_CPP_GA_LIBRARIES = [ "essentialcontacts", "eventarc", "filestore", + "financialservices", "functions", "gkebackup", "gkeconnect",