From 87717142097bf10be09f9672d275af0bb30fe47f Mon Sep 17 00:00:00 2001 From: lyxmxyl <148173533+lyxmxyl@users.noreply.github.com> Date: Mon, 10 Nov 2025 22:24:18 -0800 Subject: [PATCH] Delete google/cloud/timeseriesinsights directory API turn down --- google/cloud/timeseriesinsights/BUILD.bazel | 31 -- .../cloud/timeseriesinsights/CMakeLists.txt | 34 -- google/cloud/timeseriesinsights/README.md | 62 --- .../doc/environment-variables.dox | 49 -- google/cloud/timeseriesinsights/doc/main.dox | 50 -- .../cloud/timeseriesinsights/doc/options.dox | 10 - .../doc/override-authentication.dox | 35 -- .../doc/override-endpoint.dox | 25 - .../doc/override-retry-policies.dox | 104 ---- .../doc/override-universe-domain.dox | 24 - .../timeseriesinsights/quickstart/.bazelrc | 33 -- .../quickstart/.bazelversion | 1 - .../timeseriesinsights/quickstart/BUILD.bazel | 25 - .../quickstart/CMakeLists.txt | 32 -- .../timeseriesinsights/quickstart/Makefile | 35 -- .../timeseriesinsights/quickstart/README.md | 137 ----- .../quickstart/WORKSPACE.bazel | 53 -- .../quickstart/quickstart.cc | 41 -- .../timeseriesinsights/v1/.repo-metadata.json | 13 - ...ries_insights_controller_auth_decorator.cc | 103 ---- ...eries_insights_controller_auth_decorator.h | 88 ---- ...ies_insights_controller_connection_impl.cc | 205 -------- ...ries_insights_controller_connection_impl.h | 96 ---- ...s_insights_controller_logging_decorator.cc | 135 ----- ...es_insights_controller_logging_decorator.h | 88 ---- ..._insights_controller_metadata_decorator.cc | 129 ----- ...s_insights_controller_metadata_decorator.h | 94 ---- ...ies_insights_controller_option_defaults.cc | 77 --- ...ries_insights_controller_option_defaults.h | 37 -- ...eseries_insights_controller_retry_traits.h | 43 -- .../timeseries_insights_controller_sources.cc | 32 -- .../timeseries_insights_controller_stub.cc | 123 ----- .../timeseries_insights_controller_stub.h | 133 ----- ...series_insights_controller_stub_factory.cc | 73 --- ...eseries_insights_controller_stub_factory.h | 43 -- ..._insights_controller_tracing_connection.cc | 134 ----- ...s_insights_controller_tracing_connection.h | 98 ---- ...series_insights_controller_tracing_stub.cc | 146 ------ ...eseries_insights_controller_tracing_stub.h | 102 ---- ...imeseries_insights_controller_connection.h | 102 ---- ...ries_insights_controller_client_samples.cc | 197 ------- .../timeseries_insights_controller_client.cc | 137 ----- .../timeseries_insights_controller_client.h | 495 ------------------ ...meseries_insights_controller_connection.cc | 107 ---- ...imeseries_insights_controller_connection.h | 266 ---------- ...ontroller_connection_idempotency_policy.cc | 89 ---- ...controller_connection_idempotency_policy.h | 77 --- .../timeseries_insights_controller_options.h | 77 --- 48 files changed, 4320 deletions(-) delete mode 100644 google/cloud/timeseriesinsights/BUILD.bazel delete mode 100644 google/cloud/timeseriesinsights/CMakeLists.txt delete mode 100644 google/cloud/timeseriesinsights/README.md delete mode 100644 google/cloud/timeseriesinsights/doc/environment-variables.dox delete mode 100644 google/cloud/timeseriesinsights/doc/main.dox delete mode 100644 google/cloud/timeseriesinsights/doc/options.dox delete mode 100644 google/cloud/timeseriesinsights/doc/override-authentication.dox delete mode 100644 google/cloud/timeseriesinsights/doc/override-endpoint.dox delete mode 100644 google/cloud/timeseriesinsights/doc/override-retry-policies.dox delete mode 100644 google/cloud/timeseriesinsights/doc/override-universe-domain.dox delete mode 100644 google/cloud/timeseriesinsights/quickstart/.bazelrc delete mode 100644 google/cloud/timeseriesinsights/quickstart/.bazelversion delete mode 100644 google/cloud/timeseriesinsights/quickstart/BUILD.bazel delete mode 100644 google/cloud/timeseriesinsights/quickstart/CMakeLists.txt delete mode 100644 google/cloud/timeseriesinsights/quickstart/Makefile delete mode 100644 google/cloud/timeseriesinsights/quickstart/README.md delete mode 100644 google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel delete mode 100644 google/cloud/timeseriesinsights/quickstart/quickstart.cc delete mode 100644 google/cloud/timeseriesinsights/v1/.repo-metadata.json delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_retry_traits.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_sources.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc delete mode 100644 google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h delete mode 100644 google/cloud/timeseriesinsights/v1/mocks/mock_timeseries_insights_controller_connection.h delete mode 100644 google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc delete mode 100644 google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.cc delete mode 100644 google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.h delete mode 100644 google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.cc delete mode 100644 google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h delete mode 100644 google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.cc delete mode 100644 google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h delete mode 100644 google/cloud/timeseriesinsights/v1/timeseries_insights_controller_options.h diff --git a/google/cloud/timeseriesinsights/BUILD.bazel b/google/cloud/timeseriesinsights/BUILD.bazel deleted file mode 100644 index dc294a941059d..0000000000000 --- a/google/cloud/timeseriesinsights/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -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/timeseriesinsights/v1:timeseriesinsights_cc_grpc", -] - -cc_gapic_library( - name = "timeseriesinsights", - googleapis_deps = googleapis_deps, - service_dirs = service_dirs, -) diff --git a/google/cloud/timeseriesinsights/CMakeLists.txt b/google/cloud/timeseriesinsights/CMakeLists.txt deleted file mode 100644 index 460bed12b9884..0000000000000 --- a/google/cloud/timeseriesinsights/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# ~~~ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ~~~ - -include(GoogleCloudCppLibrary) - -google_cloud_cpp_add_gapic_library(timeseriesinsights "Timeseries Insights API" - SERVICE_DIRS "v1/") - -if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) - add_executable(timeseriesinsights_quickstart "quickstart/quickstart.cc") - target_link_libraries(timeseriesinsights_quickstart - PRIVATE google-cloud-cpp::timeseriesinsights) - google_cloud_cpp_add_common_options(timeseriesinsights_quickstart) - add_test( - NAME timeseriesinsights_quickstart - COMMAND - cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" - $ GOOGLE_CLOUD_PROJECT) - set_tests_properties(timeseriesinsights_quickstart - PROPERTIES LABELS "integration-test;quickstart") -endif () diff --git a/google/cloud/timeseriesinsights/README.md b/google/cloud/timeseriesinsights/README.md deleted file mode 100644 index aad4dc59347a0..0000000000000 --- a/google/cloud/timeseriesinsights/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Timeseries Insights API C++ Client Library - -This directory contains an idiomatic C++ client library for the -[Timeseries Insights API][cloud-service-docs], with this API users can perform -time series spike, trend, and anomaly detection. With a straightforward API and -easy to understand results, the service makes it simple to gather insights from -large amounts of time series data (e.g. monitoring datasets) and integrate these -insights in their applications. - -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/timeseriesinsights/v1/timeseries_insights_controller_client.h" -#include "google/cloud/project.h" -#include - -int main(int argc, char* argv[]) try { - if (argc != 2) { - std::cerr << "Usage: " << argv[0] << " project-id\n"; - return 1; - } - - namespace timeseriesinsights = ::google::cloud::timeseriesinsights_v1; - auto client = timeseriesinsights::TimeseriesInsightsControllerClient( - timeseriesinsights::MakeTimeseriesInsightsControllerConnection()); - - auto const project = google::cloud::Project(argv[1]); - for (auto r : client.ListDataSets(project.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 [Timeseries Insights 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/timeseries-insights -[doxygen-link]: https://cloud.google.com/cpp/docs/reference/timeseriesinsights/latest/ -[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/timeseriesinsights diff --git a/google/cloud/timeseriesinsights/doc/environment-variables.dox b/google/cloud/timeseriesinsights/doc/environment-variables.dox deleted file mode 100644 index 9a06a833330a2..0000000000000 --- a/google/cloud/timeseriesinsights/doc/environment-variables.dox +++ /dev/null @@ -1,49 +0,0 @@ -/*! -@page timeseriesinsights-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 timeseriesinsights-env-endpoint Endpoint Overrides - - - -- `GOOGLE_CLOUD_CPP_TIMESERIES_INSIGHTS_CONTROLLER_ENDPOINT=...` overrides the - `EndpointOption` (which defaults to "timeseriesinsights.googleapis.com") - used by `MakeTimeseriesInsightsControllerConnection()`. - - - -@see google::cloud::EndpointOption - -@section timeseriesinsights-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 timeseriesinsights-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/timeseriesinsights/doc/main.dox b/google/cloud/timeseriesinsights/doc/main.dox deleted file mode 100644 index 280630e71f7fb..0000000000000 --- a/google/cloud/timeseriesinsights/doc/main.dox +++ /dev/null @@ -1,50 +0,0 @@ -/*! - -@mainpage Timeseries Insights API C++ Client Library - -This directory contains an idiomatic C++ client library for the -[Timeseries Insights API][cloud-service-docs], with this API users can perform -time series spike, trend, and anomaly detection. With a straightforward API and -easy to understand results, the service makes it simple to gather insights from -large amounts of time series data (e.g. monitoring datasets) and integrate these -insights in their applications. - -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/timeseriesinsights/quickstart/` directory, -which should give you a taste of the Timeseries Insights API C++ client library API. - -@snippet quickstart.cc all - -## Main classes - - -The main class in this library is -[`timeseriesinsights_v1::TimeseriesInsightsControllerClient`](@ref google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerClient). All RPCs are exposed -as member functions of this class. Other classes provide helpers, configuration -parameters, and infrastructure to mock -[`timeseriesinsights_v1::TimeseriesInsightsControllerClient`](@ref google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerClient) when testing your -application. - - -## More Information - -- @ref common-error-handling - describes how the library reports errors. -- @ref timeseriesinsights-override-endpoint - describes how to override the default - endpoint. -- @ref timeseriesinsights-override-authentication - describes how to change the - authentication credentials used by the library. -- @ref timeseriesinsights-override-retry - describes how to change the default retry - policies. -- @ref timeseriesinsights-env - describes environment variables that can configure the - behavior of the library. - -[cloud-service-docs]: https://cloud.google.com/timeseries-insights - -*/ diff --git a/google/cloud/timeseriesinsights/doc/options.dox b/google/cloud/timeseriesinsights/doc/options.dox deleted file mode 100644 index 9de0e2575894a..0000000000000 --- a/google/cloud/timeseriesinsights/doc/options.dox +++ /dev/null @@ -1,10 +0,0 @@ -/*! -@defgroup google-cloud-timeseriesinsights-options Timeseries Insights 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/timeseriesinsights/doc/override-authentication.dox b/google/cloud/timeseriesinsights/doc/override-authentication.dox deleted file mode 100644 index 8ccc75236c91d..0000000000000 --- a/google/cloud/timeseriesinsights/doc/override-authentication.dox +++ /dev/null @@ -1,35 +0,0 @@ -/*! -@page timeseriesinsights-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 timeseries_insights_controller_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 timeseriesinsights_v1::TimeseriesInsightsControllerClient-service-account-snippet Override timeseriesinsights_v1::TimeseriesInsightsControllerClient Authentication Defaults - -@snippet google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc with-service-account - -*/ -// diff --git a/google/cloud/timeseriesinsights/doc/override-endpoint.dox b/google/cloud/timeseriesinsights/doc/override-endpoint.dox deleted file mode 100644 index 6d02108f4ef78..0000000000000 --- a/google/cloud/timeseriesinsights/doc/override-endpoint.dox +++ /dev/null @@ -1,25 +0,0 @@ -/*! -@page timeseriesinsights-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 `timeseriesinsights_v1::TimeseriesInsightsControllerClient`: - -@snippet timeseries_insights_controller_client_samples.cc set-client-endpoint - - - -*/ - -// - -/*! @page timeseriesinsights_v1::TimeseriesInsightsControllerClient-endpoint-snippet Override timeseriesinsights_v1::TimeseriesInsightsControllerClient Endpoint Configuration - -@snippet google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc set-client-endpoint - -*/ -// diff --git a/google/cloud/timeseriesinsights/doc/override-retry-policies.dox b/google/cloud/timeseriesinsights/doc/override-retry-policies.dox deleted file mode 100644 index 534dcc8b620b8..0000000000000 --- a/google/cloud/timeseriesinsights/doc/override-retry-policies.dox +++ /dev/null @@ -1,104 +0,0 @@ -/*! -@page timeseriesinsights-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 timeseriesinsights-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 timeseriesinsights-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 timeseriesinsights-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 timeseriesinsights-override-retry-example Example - - -For example, this will override the retry policies for `timeseriesinsights_v1::TimeseriesInsightsControllerClient`: - -@snippet timeseries_insights_controller_client_samples.cc set-retry-policy - -This assumes you have created a custom idempotency policy. Such as: - -@snippet timeseries_insights_controller_client_samples.cc custom-idempotency-policy - - - - -@section timeseriesinsights-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 timeseriesinsights_v1::TimeseriesInsightsControllerClient-retry-snippet Override timeseriesinsights_v1::TimeseriesInsightsControllerClient Retry Policies - -This shows how to override the retry policies for timeseriesinsights_v1::TimeseriesInsightsControllerClient: - -@snippet google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc set-retry-policy - -Assuming you have created a custom idempotency policy. Such as: - -@snippet google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc custom-idempotency-policy - -*/ -// diff --git a/google/cloud/timeseriesinsights/doc/override-universe-domain.dox b/google/cloud/timeseriesinsights/doc/override-universe-domain.dox deleted file mode 100644 index 53019168b7887..0000000000000 --- a/google/cloud/timeseriesinsights/doc/override-universe-domain.dox +++ /dev/null @@ -1,24 +0,0 @@ -/*! -@page timeseriesinsights-override-universe-domain How to Override the Default Universe Domain - -In some cases, you may need to override the default universe domain used by the -client library. Use `AddUniverseDomainOption` when initializing the client -library to change this default. - - -For example, this will override the default universe domain for `timeseriesinsights_v1::TimeseriesInsightsControllerClient`: - -@snippet timeseries_insights_controller_client_samples.cc set-client-universe-domain - - - -*/ - -// - -/*! @page timeseriesinsights_v1::TimeseriesInsightsControllerClient-universe-domain-snippet Override timeseriesinsights_v1::TimeseriesInsightsControllerClient Universe Domain - -@snippet google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc set-client-universe-domain - -*/ -// diff --git a/google/cloud/timeseriesinsights/quickstart/.bazelrc b/google/cloud/timeseriesinsights/quickstart/.bazelrc deleted file mode 100644 index 6777c6b4c95de..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/.bazelrc +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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 - -#Our quickstarts do not yet support bzlmod -build --noenable_bzlmod diff --git a/google/cloud/timeseriesinsights/quickstart/.bazelversion b/google/cloud/timeseriesinsights/quickstart/.bazelversion deleted file mode 100644 index e8be68404bcb3..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -7.6.1 diff --git a/google/cloud/timeseriesinsights/quickstart/BUILD.bazel b/google/cloud/timeseriesinsights/quickstart/BUILD.bazel deleted file mode 100644 index 4c454f202f615..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/BUILD.bazel +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) # Apache 2.0 - -cc_binary( - name = "quickstart", - srcs = [ - "quickstart.cc", - ], - deps = [ - "@google_cloud_cpp//:timeseriesinsights", - ], -) diff --git a/google/cloud/timeseriesinsights/quickstart/CMakeLists.txt b/google/cloud/timeseriesinsights/quickstart/CMakeLists.txt deleted file mode 100644 index 7479a66b9305b..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# This file shows how to use the Timeseries Insights API C++ client library from -# a larger CMake project. - -cmake_minimum_required(VERSION 3.10...3.24) -project(google-cloud-cpp-timeseriesinsights-quickstart CXX) - -find_package(google_cloud_cpp_timeseriesinsights 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::timeseriesinsights) diff --git a/google/cloud/timeseriesinsights/quickstart/Makefile b/google/cloud/timeseriesinsights/quickstart/Makefile deleted file mode 100644 index 66b7354e60c49..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This is a minimal Makefile to show how to use the Timeseries Insights 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 Timeseries Insights API C++ -# client library. -CLIENT_MODULE := google_cloud_cpp_timeseriesinsights -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/timeseriesinsights/quickstart/README.md b/google/cloud/timeseriesinsights/quickstart/README.md deleted file mode 100644 index c25cbf4e84ffd..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/README.md +++ /dev/null @@ -1,137 +0,0 @@ -# HOWTO: using the Timeseries Insights API C++ client in your project - -This directory contains small examples showing how to use the Timeseries -Insights 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. The [quickstart][quickstart-link] covers the necessary steps in -detail. - -## Configuring authentication for the C++ Client Library - -Like most Google Cloud Platform (GCP) services, Timeseries Insights 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/timeseriesinsights/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,timeseriesinsights] - ``` - - 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/timeseriesinsights/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 -[quickstart-link]: https://cloud.google.com/timeseries-insights/docs/tutorial diff --git a/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel b/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel deleted file mode 100644 index e3337d711afac..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A minimal WORKSPACE file showing how to use the Timeseries Insights 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 = "699955112a4c57ae9111fbadeff1698674a1762acd77daf36360e6dfc227dc93", - strip_prefix = "google-cloud-cpp-2.42.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v2.42.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/timeseriesinsights/quickstart/quickstart.cc b/google/cloud/timeseriesinsights/quickstart/quickstart.cc deleted file mode 100644 index a1a66be48f0b6..0000000000000 --- a/google/cloud/timeseriesinsights/quickstart/quickstart.cc +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! [all] -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.h" -#include "google/cloud/project.h" -#include - -int main(int argc, char* argv[]) try { - if (argc != 2) { - std::cerr << "Usage: " << argv[0] << " project-id\n"; - return 1; - } - - namespace timeseriesinsights = ::google::cloud::timeseriesinsights_v1; - auto client = timeseriesinsights::TimeseriesInsightsControllerClient( - timeseriesinsights::MakeTimeseriesInsightsControllerConnection()); - - auto const project = google::cloud::Project(argv[1]); - for (auto r : client.ListDataSets(project.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/timeseriesinsights/v1/.repo-metadata.json b/google/cloud/timeseriesinsights/v1/.repo-metadata.json deleted file mode 100644 index c7b71fde84ce8..0000000000000 --- a/google/cloud/timeseriesinsights/v1/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "api_id": "timeseriesinsights.googleapis.com", - "api_shortname": "timeseriesinsights", - "client_documentation": "https://cloud.google.com/cpp/docs/reference/timeseriesinsights/latest", - "distribution_name": "google-cloud-cpp", - "language": "cpp", - "library_type": "GAPIC_AUTO", - "name_pretty": "Timeseries Insights API", - "product_documentation": "https://cloud.google.com/timeseries-insights", - "release_level": "stable", - "repo": "googleapis/google-cloud-cpp", - "requires_billing": true -} diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc deleted file mode 100644 index ff70ac4de70be..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -TimeseriesInsightsControllerAuth::TimeseriesInsightsControllerAuth( - std::shared_ptr auth, - std::shared_ptr child) - : auth_(std::move(auth)), child_(std::move(child)) {} - -StatusOr -TimeseriesInsightsControllerAuth::ListDataSets( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->ListDataSets(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerAuth::CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->CreateDataSet(context, options, request); -} - -Status TimeseriesInsightsControllerAuth::DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->DeleteDataSet(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerAuth::AppendEvents( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->AppendEvents(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerAuth::QueryDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->QueryDataSet(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerAuth::EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->EvaluateSlice(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerAuth::EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->EvaluateTimeseries(context, options, request); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h deleted file mode 100644 index c848e3d606a28..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_AUTH_DECORATOR_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_AUTH_DECORATOR_H - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h" -#include "google/cloud/internal/unified_grpc_credentials.h" -#include "google/cloud/version.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class TimeseriesInsightsControllerAuth - : public TimeseriesInsightsControllerStub { - public: - ~TimeseriesInsightsControllerAuth() override = default; - TimeseriesInsightsControllerAuth( - std::shared_ptr auth, - std::shared_ptr child); - - StatusOr - ListDataSets(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& - request) override; - - StatusOr CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) override; - - Status DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) override; - - StatusOr - AppendEvents(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) override; - - StatusOr - QueryDataSet(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) override; - - StatusOr EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) override; - - StatusOr - EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) override; - - private: - std::shared_ptr auth_; - std::shared_ptr child_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_AUTH_DECORATOR_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.cc deleted file mode 100644 index 67f07c73adc95..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.cc +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.h" -#include "google/cloud/background_threads.h" -#include "google/cloud/common_options.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/internal/pagination_range.h" -#include "google/cloud/internal/retry_loop.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -std::unique_ptr -retry_policy(Options const& options) { - return options - .get() - ->clone(); -} - -std::unique_ptr backoff_policy(Options const& options) { - return options - .get() - ->clone(); -} - -std::unique_ptr -idempotency_policy(Options const& options) { - return options - .get() - ->clone(); -} - -} // namespace - -TimeseriesInsightsControllerConnectionImpl:: - TimeseriesInsightsControllerConnectionImpl( - std::unique_ptr background, - std::shared_ptr< - timeseriesinsights_v1_internal::TimeseriesInsightsControllerStub> - stub, - Options options) - : background_(std::move(background)), - stub_(std::move(stub)), - options_(internal::MergeOptions( - std::move(options), - TimeseriesInsightsControllerConnection::options())) {} - -StreamRange -TimeseriesInsightsControllerConnectionImpl::ListDataSets( - google::cloud::timeseriesinsights::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< - timeseriesinsights_v1::TimeseriesInsightsControllerRetryPolicy>( - retry_policy(*current)), - backoff = std::shared_ptr(backoff_policy(*current))]( - Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& r) { - return google::cloud::internal::RetryLoop( - retry->clone(), backoff->clone(), idempotency, - [stub](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1:: - ListDataSetsRequest const& request) { - return stub->ListDataSets(context, options, request); - }, - options, r, function_name); - }, - [](google::cloud::timeseriesinsights::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 -TimeseriesInsightsControllerConnectionImpl::CreateDataSet( - google::cloud::timeseriesinsights::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::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - return stub_->CreateDataSet(context, options, request); - }, - *current, request, __func__); -} - -Status TimeseriesInsightsControllerConnectionImpl::DeleteDataSet( - google::cloud::timeseriesinsights::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::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - return stub_->DeleteDataSet(context, options, request); - }, - *current, request, __func__); -} - -StatusOr -TimeseriesInsightsControllerConnectionImpl::AppendEvents( - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->AppendEvents(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) { - return stub_->AppendEvents(context, options, request); - }, - *current, request, __func__); -} - -StatusOr -TimeseriesInsightsControllerConnectionImpl::QueryDataSet( - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->QueryDataSet(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) { - return stub_->QueryDataSet(context, options, request); - }, - *current, request, __func__); -} - -StatusOr -TimeseriesInsightsControllerConnectionImpl::EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->EvaluateSlice(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - return stub_->EvaluateSlice(context, options, request); - }, - *current, request, __func__); -} - -StatusOr -TimeseriesInsightsControllerConnectionImpl::EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->EvaluateTimeseries(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1:: - EvaluateTimeseriesRequest const& request) { - return stub_->EvaluateTimeseries(context, options, request); - }, - *current, request, __func__); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.h deleted file mode 100644 index f7bda458ed386..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IMPL_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IMPL_H - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_retry_traits.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_options.h" -#include "google/cloud/background_threads.h" -#include "google/cloud/backoff_policy.h" -#include "google/cloud/options.h" -#include "google/cloud/status_or.h" -#include "google/cloud/stream_range.h" -#include "google/cloud/version.h" -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class TimeseriesInsightsControllerConnectionImpl - : public timeseriesinsights_v1::TimeseriesInsightsControllerConnection { - public: - ~TimeseriesInsightsControllerConnectionImpl() override = default; - - TimeseriesInsightsControllerConnectionImpl( - std::unique_ptr background, - std::shared_ptr< - timeseriesinsights_v1_internal::TimeseriesInsightsControllerStub> - stub, - Options options); - - Options options() override { return options_; } - - StreamRange ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request) - override; - - StatusOr CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) override; - - Status DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) override; - - StatusOr - AppendEvents(google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) override; - - StatusOr - QueryDataSet(google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) override; - - StatusOr EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) override; - - StatusOr - EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) override; - - private: - std::unique_ptr background_; - std::shared_ptr< - timeseriesinsights_v1_internal::TimeseriesInsightsControllerStub> - stub_; - Options options_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IMPL_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc deleted file mode 100644 index d87ea7a2b7fed..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_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 timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -TimeseriesInsightsControllerLogging::TimeseriesInsightsControllerLogging( - std::shared_ptr child, - TracingOptions tracing_options, std::set const&) - : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} - -StatusOr -TimeseriesInsightsControllerLogging::ListDataSets( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& - request) { - return child_->ListDataSets(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -TimeseriesInsightsControllerLogging::CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - return child_->CreateDataSet(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -Status TimeseriesInsightsControllerLogging::DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - return child_->DeleteDataSet(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -TimeseriesInsightsControllerLogging::AppendEvents( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) { - return child_->AppendEvents(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -TimeseriesInsightsControllerLogging::QueryDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) { - return child_->QueryDataSet(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -TimeseriesInsightsControllerLogging::EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - return child_->EvaluateSlice(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -TimeseriesInsightsControllerLogging::EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1:: - EvaluateTimeseriesRequest const& request) { - return child_->EvaluateTimeseries(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h deleted file mode 100644 index 496b39d656940..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_LOGGING_DECORATOR_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_LOGGING_DECORATOR_H - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h" -#include "google/cloud/tracing_options.h" -#include "google/cloud/version.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class TimeseriesInsightsControllerLogging - : public TimeseriesInsightsControllerStub { - public: - ~TimeseriesInsightsControllerLogging() override = default; - TimeseriesInsightsControllerLogging( - std::shared_ptr child, - TracingOptions tracing_options, std::set const& components); - - StatusOr - ListDataSets(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& - request) override; - - StatusOr CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) override; - - Status DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) override; - - StatusOr - AppendEvents(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) override; - - StatusOr - QueryDataSet(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) override; - - StatusOr EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) override; - - StatusOr - EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) override; - - private: - std::shared_ptr child_; - TracingOptions tracing_options_; -}; // TimeseriesInsightsControllerLogging - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_LOGGING_DECORATOR_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc deleted file mode 100644 index dbd6e867da7d1..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/internal/absl_str_cat_quiet.h" -#include "google/cloud/internal/api_client_header.h" -#include "google/cloud/internal/url_encode.h" -#include "google/cloud/status_or.h" -#include -#include -#include -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -TimeseriesInsightsControllerMetadata::TimeseriesInsightsControllerMetadata( - 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 -TimeseriesInsightsControllerMetadata::ListDataSets( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->ListDataSets(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerMetadata::CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->CreateDataSet(context, options, request); -} - -Status TimeseriesInsightsControllerMetadata::DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - SetMetadata(context, options, - absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->DeleteDataSet(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerMetadata::AppendEvents( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request) { - SetMetadata(context, options, - absl::StrCat("dataset=", internal::UrlEncode(request.dataset()))); - return child_->AppendEvents(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerMetadata::QueryDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request) { - SetMetadata(context, options, - absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->QueryDataSet(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerMetadata::EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - SetMetadata(context, options, - absl::StrCat("dataset=", internal::UrlEncode(request.dataset()))); - return child_->EvaluateSlice(context, options, request); -} - -StatusOr -TimeseriesInsightsControllerMetadata::EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->EvaluateTimeseries(context, options, request); -} - -void TimeseriesInsightsControllerMetadata::SetMetadata( - grpc::ClientContext& context, Options const& options, - std::string const& request_params) { - context.AddMetadata("x-goog-request-params", request_params); - SetMetadata(context, options); -} - -void TimeseriesInsightsControllerMetadata::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 timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h deleted file mode 100644 index d445bcda73d7b..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_METADATA_DECORATOR_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_METADATA_DECORATOR_H - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h" -#include "google/cloud/options.h" -#include "google/cloud/version.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class TimeseriesInsightsControllerMetadata - : public TimeseriesInsightsControllerStub { - public: - ~TimeseriesInsightsControllerMetadata() override = default; - TimeseriesInsightsControllerMetadata( - std::shared_ptr child, - std::multimap fixed_metadata, - std::string api_client_header = ""); - - StatusOr - ListDataSets(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& - request) override; - - StatusOr CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) override; - - Status DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) override; - - StatusOr - AppendEvents(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) override; - - StatusOr - QueryDataSet(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) override; - - StatusOr EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) override; - - StatusOr - EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest 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 timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_METADATA_DECORATOR_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc deleted file mode 100644 index c090d9764c0ad..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_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 timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -namespace { -auto constexpr kBackoffScaling = 2.0; -} // namespace - -Options TimeseriesInsightsControllerDefaultOptions(Options options) { - options = internal::PopulateCommonOptions( - std::move(options), - "GOOGLE_CLOUD_CPP_TIMESERIES_INSIGHTS_CONTROLLER_ENDPOINT", "", - "GOOGLE_CLOUD_CPP_TIMESERIES_INSIGHTS_CONTROLLER_AUTHORITY", - "timeseriesinsights.googleapis.com"); - options = internal::PopulateGrpcOptions(std::move(options)); - if (!options.has()) { - options.set< - timeseriesinsights_v1::TimeseriesInsightsControllerRetryPolicyOption>( - timeseriesinsights_v1:: - TimeseriesInsightsControllerLimitedTimeRetryPolicy( - std::chrono::minutes(30)) - .clone()); - } - if (!options.has()) { - options.set< - timeseriesinsights_v1::TimeseriesInsightsControllerBackoffPolicyOption>( - ExponentialBackoffPolicy( - std::chrono::seconds(0), std::chrono::seconds(1), - std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) - .clone()); - } - if (!options.has< - timeseriesinsights_v1:: - TimeseriesInsightsControllerConnectionIdempotencyPolicyOption>()) { - options.set< - timeseriesinsights_v1:: - TimeseriesInsightsControllerConnectionIdempotencyPolicyOption>( - timeseriesinsights_v1:: - MakeDefaultTimeseriesInsightsControllerConnectionIdempotencyPolicy()); - } - - return options; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.h deleted file mode 100644 index f7e15fa243fc0..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_OPTION_DEFAULTS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_OPTION_DEFAULTS_H - -#include "google/cloud/options.h" -#include "google/cloud/version.h" - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -Options TimeseriesInsightsControllerDefaultOptions(Options options); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_OPTION_DEFAULTS_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_retry_traits.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_retry_traits.h deleted file mode 100644 index a4e2efd41aa4b..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_retry_traits.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_RETRY_TRAITS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_RETRY_TRAITS_H - -#include "google/cloud/status.h" -#include "google/cloud/version.h" - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// Define the gRPC status code semantics for retrying requests. -struct TimeseriesInsightsControllerRetryTraits { - static bool IsPermanentFailure(google::cloud::Status const& status) { - return status.code() != StatusCode::kOk && - status.code() != StatusCode::kUnavailable; - } -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_RETRY_TRAITS_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_sources.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_sources.cc deleted file mode 100644 index 7164ea4979063..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_sources.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -// NOLINTBEGIN(bugprone-suspicious-include) -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.cc" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.cc" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.cc" -// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.cc deleted file mode 100644 index f7086f5820e93..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.cc +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h" -#include "google/cloud/grpc_error_delegate.h" -#include "google/cloud/status_or.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -TimeseriesInsightsControllerStub::~TimeseriesInsightsControllerStub() = default; - -StatusOr -DefaultTimeseriesInsightsControllerStub::ListDataSets( - grpc::ClientContext& context, Options const&, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& request) { - google::cloud::timeseriesinsights::v1::ListDataSetsResponse response; - auto status = grpc_stub_->ListDataSets(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultTimeseriesInsightsControllerStub::CreateDataSet( - grpc::ClientContext& context, Options const&, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - google::cloud::timeseriesinsights::v1::DataSet response; - auto status = grpc_stub_->CreateDataSet(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -Status DefaultTimeseriesInsightsControllerStub::DeleteDataSet( - grpc::ClientContext& context, Options const&, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - google::protobuf::Empty response; - auto status = grpc_stub_->DeleteDataSet(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return google::cloud::Status(); -} - -StatusOr -DefaultTimeseriesInsightsControllerStub::AppendEvents( - grpc::ClientContext& context, Options const&, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request) { - google::cloud::timeseriesinsights::v1::AppendEventsResponse response; - auto status = grpc_stub_->AppendEvents(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultTimeseriesInsightsControllerStub::QueryDataSet( - grpc::ClientContext& context, Options const&, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request) { - google::cloud::timeseriesinsights::v1::QueryDataSetResponse response; - auto status = grpc_stub_->QueryDataSet(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultTimeseriesInsightsControllerStub::EvaluateSlice( - grpc::ClientContext& context, Options const&, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - google::cloud::timeseriesinsights::v1::EvaluatedSlice response; - auto status = grpc_stub_->EvaluateSlice(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultTimeseriesInsightsControllerStub::EvaluateTimeseries( - grpc::ClientContext& context, Options const&, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) { - google::cloud::timeseriesinsights::v1::EvaluatedSlice response; - auto status = grpc_stub_->EvaluateTimeseries(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h deleted file mode 100644 index 888df3a1ee540..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_H - -#include "google/cloud/options.h" -#include "google/cloud/status_or.h" -#include "google/cloud/version.h" -#include -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class TimeseriesInsightsControllerStub { - public: - virtual ~TimeseriesInsightsControllerStub() = 0; - - virtual StatusOr - ListDataSets(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& - request) = 0; - - virtual StatusOr - CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) = 0; - - virtual Status DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) = 0; - - virtual StatusOr - AppendEvents(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) = 0; - - virtual StatusOr - QueryDataSet(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) = 0; - - virtual StatusOr - EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) = 0; - - virtual StatusOr - EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) = 0; -}; - -class DefaultTimeseriesInsightsControllerStub - : public TimeseriesInsightsControllerStub { - public: - explicit DefaultTimeseriesInsightsControllerStub( - std::unique_ptr - grpc_stub) - : grpc_stub_(std::move(grpc_stub)) {} - - StatusOr - ListDataSets(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& - request) override; - - StatusOr CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) override; - - Status DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) override; - - StatusOr - AppendEvents(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) override; - - StatusOr - QueryDataSet(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) override; - - StatusOr EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) override; - - StatusOr - EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) override; - - private: - std::unique_ptr - grpc_stub_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc deleted file mode 100644 index 2305b3e61e340..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.cc +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_auth_decorator.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_logging_decorator.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_metadata_decorator.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h" -#include "google/cloud/common_options.h" -#include "google/cloud/grpc_options.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 - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr -CreateDefaultTimeseriesInsightsControllerStub( - std::shared_ptr auth, - Options const& options) { - auto channel = auth->CreateChannel(options.get(), - internal::MakeChannelArguments(options)); - auto service_grpc_stub = google::cloud::timeseriesinsights::v1:: - TimeseriesInsightsController::NewStub(channel); - std::shared_ptr stub = - std::make_shared( - std::move(service_grpc_stub)); - - if (auth->RequiresConfigureContext()) { - stub = std::make_shared(std::move(auth), - std::move(stub)); - } - stub = std::make_shared( - std::move(stub), std::multimap{}); - if (internal::Contains(options.get(), "rpc")) { - GCP_LOG(INFO) << "Enabled logging for gRPC calls"; - stub = std::make_shared( - std::move(stub), options.get(), - options.get()); - } - if (internal::TracingEnabled(options)) { - stub = MakeTimeseriesInsightsControllerTracingStub(std::move(stub)); - } - return stub; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h deleted file mode 100644 index 502858b0d904a..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_FACTORY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_FACTORY_H - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_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 timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -std::shared_ptr -CreateDefaultTimeseriesInsightsControllerStub( - std::shared_ptr auth, - Options const& options); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_STUB_FACTORY_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc deleted file mode 100644 index e873f7d0b5d38..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.cc +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h" -#include "google/cloud/internal/opentelemetry.h" -#include "google/cloud/internal/traced_stream_range.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -TimeseriesInsightsControllerTracingConnection:: - TimeseriesInsightsControllerTracingConnection( - std::shared_ptr< - timeseriesinsights_v1::TimeseriesInsightsControllerConnection> - child) - : child_(std::move(child)) {} - -StreamRange -TimeseriesInsightsControllerTracingConnection::ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request) { - auto span = internal::MakeSpan( - "timeseriesinsights_v1::TimeseriesInsightsControllerConnection::" - "ListDataSets"); - internal::OTelScope scope(span); - auto sr = child_->ListDataSets(std::move(request)); - return internal::MakeTracedStreamRange< - google::cloud::timeseriesinsights::v1::DataSet>(std::move(span), - std::move(sr)); -} - -StatusOr -TimeseriesInsightsControllerTracingConnection::CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - auto span = internal::MakeSpan( - "timeseriesinsights_v1::TimeseriesInsightsControllerConnection::" - "CreateDataSet"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->CreateDataSet(request)); -} - -Status TimeseriesInsightsControllerTracingConnection::DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - auto span = internal::MakeSpan( - "timeseriesinsights_v1::TimeseriesInsightsControllerConnection::" - "DeleteDataSet"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->DeleteDataSet(request)); -} - -StatusOr -TimeseriesInsightsControllerTracingConnection::AppendEvents( - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request) { - auto span = internal::MakeSpan( - "timeseriesinsights_v1::TimeseriesInsightsControllerConnection::" - "AppendEvents"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->AppendEvents(request)); -} - -StatusOr -TimeseriesInsightsControllerTracingConnection::QueryDataSet( - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request) { - auto span = internal::MakeSpan( - "timeseriesinsights_v1::TimeseriesInsightsControllerConnection::" - "QueryDataSet"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->QueryDataSet(request)); -} - -StatusOr -TimeseriesInsightsControllerTracingConnection::EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - auto span = internal::MakeSpan( - "timeseriesinsights_v1::TimeseriesInsightsControllerConnection::" - "EvaluateSlice"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->EvaluateSlice(request)); -} - -StatusOr -TimeseriesInsightsControllerTracingConnection::EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) { - auto span = internal::MakeSpan( - "timeseriesinsights_v1::TimeseriesInsightsControllerConnection::" - "EvaluateTimeseries"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->EvaluateTimeseries(request)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr -MakeTimeseriesInsightsControllerTracingConnection( - std::shared_ptr< - timeseriesinsights_v1::TimeseriesInsightsControllerConnection> - conn) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - if (internal::TracingEnabled(conn->options())) { - conn = std::make_shared( - std::move(conn)); - } -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - return conn; -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h deleted file mode 100644 index f0637f15e1967..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_TRACING_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_TRACING_CONNECTION_H - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h" -#include "google/cloud/version.h" -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -class TimeseriesInsightsControllerTracingConnection - : public timeseriesinsights_v1::TimeseriesInsightsControllerConnection { - public: - ~TimeseriesInsightsControllerTracingConnection() override = default; - - explicit TimeseriesInsightsControllerTracingConnection( - std::shared_ptr< - timeseriesinsights_v1::TimeseriesInsightsControllerConnection> - child); - - Options options() override { return child_->options(); } - - StreamRange ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request) - override; - - StatusOr CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) override; - - Status DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) override; - - StatusOr - AppendEvents(google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) override; - - StatusOr - QueryDataSet(google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) override; - - StatusOr EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) override; - - StatusOr - EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest 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 -MakeTimeseriesInsightsControllerTracingConnection( - std::shared_ptr< - timeseriesinsights_v1::TimeseriesInsightsControllerConnection> - conn); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_TRACING_CONNECTION_H diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc deleted file mode 100644 index c610487c4cfdd..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.cc +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h" -#include "google/cloud/internal/grpc_opentelemetry.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -TimeseriesInsightsControllerTracingStub:: - TimeseriesInsightsControllerTracingStub( - std::shared_ptr child) - : child_(std::move(child)), propagator_(internal::MakePropagator()) {} - -StatusOr -TimeseriesInsightsControllerTracingStub::ListDataSets( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.timeseriesinsights.v1.TimeseriesInsightsController", - "ListDataSets"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListDataSets(context, options, request)); -} - -StatusOr -TimeseriesInsightsControllerTracingStub::CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.timeseriesinsights.v1.TimeseriesInsightsController", - "CreateDataSet"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->CreateDataSet(context, options, request)); -} - -Status TimeseriesInsightsControllerTracingStub::DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.timeseriesinsights.v1.TimeseriesInsightsController", - "DeleteDataSet"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->DeleteDataSet(context, options, request)); -} - -StatusOr -TimeseriesInsightsControllerTracingStub::AppendEvents( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.timeseriesinsights.v1.TimeseriesInsightsController", - "AppendEvents"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->AppendEvents(context, options, request)); -} - -StatusOr -TimeseriesInsightsControllerTracingStub::QueryDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.timeseriesinsights.v1.TimeseriesInsightsController", - "QueryDataSet"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->QueryDataSet(context, options, request)); -} - -StatusOr -TimeseriesInsightsControllerTracingStub::EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.timeseriesinsights.v1.TimeseriesInsightsController", - "EvaluateSlice"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->EvaluateSlice(context, options, request)); -} - -StatusOr -TimeseriesInsightsControllerTracingStub::EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request) { - auto span = internal::MakeSpanGrpc( - "google.cloud.timeseriesinsights.v1.TimeseriesInsightsController", - "EvaluateTimeseries"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->EvaluateTimeseries(context, options, request)); -} - -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -std::shared_ptr -MakeTimeseriesInsightsControllerTracingStub( - std::shared_ptr stub) { -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - return std::make_shared( - std::move(stub)); -#else - return stub; -#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h b/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h deleted file mode 100644 index e2fb882ed1e8d..0000000000000 --- a/google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_stub.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_TRACING_STUB_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_TRACING_STUB_H - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_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 timeseriesinsights_v1_internal { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY - -class TimeseriesInsightsControllerTracingStub - : public TimeseriesInsightsControllerStub { - public: - ~TimeseriesInsightsControllerTracingStub() override = default; - - explicit TimeseriesInsightsControllerTracingStub( - std::shared_ptr child); - - StatusOr - ListDataSets(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::ListDataSetsRequest const& - request) override; - - StatusOr CreateDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request) override; - - Status DeleteDataSet( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request) override; - - StatusOr - AppendEvents(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request) override; - - StatusOr - QueryDataSet(grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request) override; - - StatusOr EvaluateSlice( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request) override; - - StatusOr - EvaluateTimeseries( - grpc::ClientContext& context, Options const& options, - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest 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 -MakeTimeseriesInsightsControllerTracingStub( - std::shared_ptr stub); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_internal -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_INTERNAL_TIMESERIES_INSIGHTS_CONTROLLER_TRACING_STUB_H diff --git a/google/cloud/timeseriesinsights/v1/mocks/mock_timeseries_insights_controller_connection.h b/google/cloud/timeseriesinsights/v1/mocks/mock_timeseries_insights_controller_connection.h deleted file mode 100644 index 418634cd08846..0000000000000 --- a/google/cloud/timeseriesinsights/v1/mocks/mock_timeseries_insights_controller_connection.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_MOCKS_MOCK_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_MOCKS_MOCK_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_H - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h" -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1_mocks { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * A class to mock `TimeseriesInsightsControllerConnection`. - * - * Application developers may want to test their code with simulated responses, - * including errors, from an object of type - * `TimeseriesInsightsControllerClient`. To do so, construct an object of type - * `TimeseriesInsightsControllerClient` 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 MockTimeseriesInsightsControllerConnection - : public timeseriesinsights_v1::TimeseriesInsightsControllerConnection { - public: - MOCK_METHOD(Options, options, (), (override)); - - MOCK_METHOD( - (StreamRange), - ListDataSets, - (google::cloud::timeseriesinsights::v1::ListDataSetsRequest request), - (override)); - - MOCK_METHOD( - StatusOr, CreateDataSet, - (google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request), - (override)); - - MOCK_METHOD( - Status, DeleteDataSet, - (google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request), - (override)); - - MOCK_METHOD( - StatusOr, - AppendEvents, - (google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request), - (override)); - - MOCK_METHOD( - StatusOr, - QueryDataSet, - (google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request), - (override)); - - MOCK_METHOD( - StatusOr, - EvaluateSlice, - (google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request), - (override)); - - MOCK_METHOD( - StatusOr, - EvaluateTimeseries, - (google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request), - (override)); -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1_mocks -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_MOCKS_MOCK_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_H diff --git a/google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc b/google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc deleted file mode 100644 index 8ac5aef053fe2..0000000000000 --- a/google/cloud/timeseriesinsights/v1/samples/timeseries_insights_controller_client_samples.cc +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_options.h" -#include "google/cloud/common_options.h" -#include "google/cloud/credentials.h" -#include "google/cloud/internal/getenv.h" -#include "google/cloud/testing_util/example_driver.h" -#include "google/cloud/universe_domain.h" -#include -#include -#include -#include - -// clang-format off -// main-dox-marker: timeseriesinsights_v1::TimeseriesInsightsControllerClient -// clang-format on -namespace { - -void SetClientEndpoint(std::vector const& argv) { - if (!argv.empty()) { - throw google::cloud::testing_util::Usage{"set-client-endpoint"}; - } - //! [set-client-endpoint] - // This configuration is common with Private Google Access: - // https://cloud.google.com/vpc/docs/private-google-access - auto options = google::cloud::Options{}.set( - "private.googleapis.com"); - auto vpc_client = - google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerClient( - google::cloud::timeseriesinsights_v1:: - MakeTimeseriesInsightsControllerConnection(options)); - //! [set-client-endpoint] -} - -void SetClientUniverseDomain(std::vector const& argv) { - if (!argv.empty()) { - throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; - } - //! [set-client-universe-domain] - google::cloud::Options options; - - // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, - // in the provided Options for the Universe Domain associated with the - // credentials and adds it to the set of Options. - // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. - auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); - - if (!ud_options.ok()) throw std::move(ud_options).status(); - auto ud_client = - google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerClient( - google::cloud::timeseriesinsights_v1:: - MakeTimeseriesInsightsControllerConnection(*ud_options)); - //! [set-client-universe-domain] -} - -//! [custom-idempotency-policy] -class CustomIdempotencyPolicy - : public google::cloud::timeseriesinsights_v1:: - TimeseriesInsightsControllerConnectionIdempotencyPolicy { - public: - ~CustomIdempotencyPolicy() override = default; - std::unique_ptr - clone() const override { - return std::make_unique(*this); - } - // Override inherited functions to define as needed. -}; -//! [custom-idempotency-policy] - -void SetRetryPolicy(std::vector const& argv) { - if (!argv.empty()) { - throw google::cloud::testing_util::Usage{"set-client-retry-policy"}; - } - //! [set-retry-policy] - auto options = - google::cloud::Options{} - .set< - google::cloud::timeseriesinsights_v1:: - TimeseriesInsightsControllerConnectionIdempotencyPolicyOption>( - CustomIdempotencyPolicy().clone()) - .set( - google::cloud::timeseriesinsights_v1:: - TimeseriesInsightsControllerLimitedErrorCountRetryPolicy(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::timeseriesinsights_v1:: - MakeTimeseriesInsightsControllerConnection(options); - - // c1 and c2 share the same retry policies - auto c1 = - google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerClient( - connection); - auto c2 = - google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerClient( - 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::timeseriesinsights_v1::TimeseriesInsightsControllerClient( - connection, - google::cloud::Options{} - .set( - google::cloud::timeseriesinsights_v1:: - TimeseriesInsightsControllerLimitedTimeRetryPolicy( - std::chrono::minutes(5)) - .clone())); - - // You can also override the policies in a single call: - // c3.SomeRpc(..., google::cloud::Options{} - // .set( - // google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerLimitedErrorCountRetryPolicy(10).clone())); - //! [set-retry-policy] -} - -void WithServiceAccount(std::vector const& argv) { - if (argv.size() != 1 || argv[0] == "--help") { - throw google::cloud::testing_util::Usage{"with-service-account "}; - } - //! [with-service-account] - [](std::string const& keyfile) { - auto is = std::ifstream(keyfile); - is.exceptions(std::ios::badbit); // Minimal error handling in examples - auto contents = std::string(std::istreambuf_iterator(is.rdbuf()), {}); - auto options = - google::cloud::Options{}.set( - google::cloud::MakeServiceAccountCredentials(contents)); - return google::cloud::timeseriesinsights_v1:: - TimeseriesInsightsControllerClient( - google::cloud::timeseriesinsights_v1:: - MakeTimeseriesInsightsControllerConnection(options)); - } - //! [with-service-account] - (argv.at(0)); -} - -void AutoRun(std::vector const& argv) { - namespace examples = ::google::cloud::testing_util; - using ::google::cloud::internal::GetEnv; - if (!argv.empty()) throw examples::Usage{"auto"}; - examples::CheckEnvironmentVariablesAreSet( - {"GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE"}); - auto const keyfile = - GetEnv("GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE").value(); - - std::cout << "\nRunning SetClientEndpoint() example" << std::endl; - SetClientEndpoint({}); - - std::cout << "\nRunning SetRetryPolicy() example" << std::endl; - SetRetryPolicy({}); - - std::cout << "\nRunning WithServiceAccount() example" << std::endl; - WithServiceAccount({keyfile}); - - std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; - SetClientUniverseDomain({}); -} - -} // namespace - -int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) - google::cloud::testing_util::Example example({ - {"set-client-endpoint", SetClientEndpoint}, - {"set-retry-policy", SetRetryPolicy}, - {"with-service-account", WithServiceAccount}, - {"set-client-universe-domain", SetClientUniverseDomain}, - {"auto", AutoRun}, - }); - return example.Run(argc, argv); -} diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.cc b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.cc deleted file mode 100644 index ad389b942b403..0000000000000 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.cc +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -TimeseriesInsightsControllerClient::TimeseriesInsightsControllerClient( - std::shared_ptr connection, - Options opts) - : connection_(std::move(connection)), - options_( - internal::MergeOptions(std::move(opts), connection_->options())) {} -TimeseriesInsightsControllerClient::~TimeseriesInsightsControllerClient() = - default; - -StreamRange -TimeseriesInsightsControllerClient::ListDataSets(std::string const& parent, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request; - request.set_parent(parent); - return connection_->ListDataSets(request); -} - -StreamRange -TimeseriesInsightsControllerClient::ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->ListDataSets(std::move(request)); -} - -StatusOr -TimeseriesInsightsControllerClient::CreateDataSet( - std::string const& parent, - google::cloud::timeseriesinsights::v1::DataSet const& dataset, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::timeseriesinsights::v1::CreateDataSetRequest request; - request.set_parent(parent); - *request.mutable_dataset() = dataset; - return connection_->CreateDataSet(request); -} - -StatusOr -TimeseriesInsightsControllerClient::CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->CreateDataSet(request); -} - -Status TimeseriesInsightsControllerClient::DeleteDataSet( - std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest request; - request.set_name(name); - return connection_->DeleteDataSet(request); -} - -Status TimeseriesInsightsControllerClient::DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->DeleteDataSet(request); -} - -StatusOr -TimeseriesInsightsControllerClient::AppendEvents( - std::string const& dataset, - std::vector const& events, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::timeseriesinsights::v1::AppendEventsRequest request; - request.set_dataset(dataset); - *request.mutable_events() = {events.begin(), events.end()}; - return connection_->AppendEvents(request); -} - -StatusOr -TimeseriesInsightsControllerClient::AppendEvents( - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->AppendEvents(request); -} - -StatusOr -TimeseriesInsightsControllerClient::QueryDataSet( - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->QueryDataSet(request); -} - -StatusOr -TimeseriesInsightsControllerClient::EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->EvaluateSlice(request); -} - -StatusOr -TimeseriesInsightsControllerClient::EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->EvaluateTimeseries(request); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1 -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.h b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.h deleted file mode 100644 index aae3d5ec3703e..0000000000000 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_client.h +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CLIENT_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CLIENT_H - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h" -#include "google/cloud/future.h" -#include "google/cloud/options.h" -#include "google/cloud/polling_policy.h" -#include "google/cloud/status_or.h" -#include "google/cloud/version.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// -/// TimeseriesInsightsControllerClient -/// -/// @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 TimeseriesInsightsControllerClient { - public: - explicit TimeseriesInsightsControllerClient( - std::shared_ptr connection, - Options opts = {}); - ~TimeseriesInsightsControllerClient(); - - ///@{ - /// @name Copy and move support - TimeseriesInsightsControllerClient( - TimeseriesInsightsControllerClient const&) = default; - TimeseriesInsightsControllerClient& operator=( - TimeseriesInsightsControllerClient const&) = default; - TimeseriesInsightsControllerClient(TimeseriesInsightsControllerClient&&) = - default; - TimeseriesInsightsControllerClient& operator=( - TimeseriesInsightsControllerClient&&) = default; - ///@} - - ///@{ - /// @name Equality - friend bool operator==(TimeseriesInsightsControllerClient const& a, - TimeseriesInsightsControllerClient const& b) { - return a.connection_ == b.connection_; - } - friend bool operator!=(TimeseriesInsightsControllerClient const& a, - TimeseriesInsightsControllerClient const& b) { - return !(a == b); - } - ///@} - - // clang-format off - /// - /// Lists [DataSets][google.cloud.timeseriesinsights.v1.DataSet] under the project. - /// - /// The order of the results is unspecified but deterministic. Newly created - /// [DataSets][google.cloud.timeseriesinsights.v1.DataSet] will not necessarily be added to the end - /// of this list. - /// - /// @param parent Required. Project owning the DataSet in the format of "projects/{project}". - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return a [StreamRange](@ref google::cloud::StreamRange) - /// to iterate of the results. See the documentation of this type for - /// details. In brief, this class has `begin()` and `end()` member - /// functions returning a iterator class meeting the - /// [input iterator requirements]. The value type for this iterator is a - /// [`StatusOr`] as the iteration may fail even after some values are - /// retrieved successfully, for example, if there is a network disconnect. - /// An empty set of results does not indicate an error, it indicates - /// that there are no resources meeting the request criteria. - /// On a successful iteration the `StatusOr` contains elements of type - /// [google.cloud.timeseriesinsights.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.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// [google.cloud.timeseriesinsights.v1.ListDataSetsRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L362} - /// - // clang-format on - StreamRange ListDataSets( - std::string const& parent, Options opts = {}); - - // clang-format off - /// - /// Lists [DataSets][google.cloud.timeseriesinsights.v1.DataSet] under the project. - /// - /// The order of the results is unspecified but deterministic. Newly created - /// [DataSets][google.cloud.timeseriesinsights.v1.DataSet] will not necessarily be added to the end - /// of this list. - /// - /// @param request Unary RPCs, such as the one wrapped by this - /// function, receive a single `request` proto message which includes all - /// the inputs for the RPC. In this case, the proto message is a - /// [google.cloud.timeseriesinsights.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.timeseriesinsights.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.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// [google.cloud.timeseriesinsights.v1.ListDataSetsRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L362} - /// - // clang-format on - StreamRange ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request, - Options opts = {}); - - // clang-format off - /// - /// Create a [DataSet][google.cloud.timeseriesinsights.v1.DataSet] from data stored on Cloud - /// Storage. - /// - /// The data must stay immutable while we process the - /// [DataSet][google.cloud.timeseriesinsights.v1.DataSet] creation; otherwise, undefined outcomes - /// might result. For more information, see [DataSet][google.cloud.timeseriesinsights.v1.DataSet]. - /// - /// @param parent Required. Client project name which will own this DataSet in the format of - /// 'projects/{project}'. - /// @param dataset Required. Dataset to be loaded. - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return the result of the RPC. The response message type - /// ([google.cloud.timeseriesinsights.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.timeseriesinsights.v1.CreateDataSetRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L336} - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// - // clang-format on - StatusOr CreateDataSet( - std::string const& parent, - google::cloud::timeseriesinsights::v1::DataSet const& dataset, - Options opts = {}); - - // clang-format off - /// - /// Create a [DataSet][google.cloud.timeseriesinsights.v1.DataSet] from data stored on Cloud - /// Storage. - /// - /// The data must stay immutable while we process the - /// [DataSet][google.cloud.timeseriesinsights.v1.DataSet] creation; otherwise, undefined outcomes - /// might result. For more information, see [DataSet][google.cloud.timeseriesinsights.v1.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.timeseriesinsights.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 the result of the RPC. The response message type - /// ([google.cloud.timeseriesinsights.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.timeseriesinsights.v1.CreateDataSetRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L336} - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// - // clang-format on - StatusOr CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request, - Options opts = {}); - - // clang-format off - /// - /// Delete a [DataSet][google.cloud.timeseriesinsights.v1.DataSet] from the system. - /// - /// **NOTE**: If the [DataSet][google.cloud.timeseriesinsights.v1.DataSet] is still being - /// processed, it will be aborted and deleted. - /// - /// @param name Required. Dataset name in the format of "projects/{project}/datasets/{dataset}" - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return a [`Status`] object. If the request failed, the - /// status contains the details of the failure. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// [google.cloud.timeseriesinsights.v1.DeleteDataSetRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L351} - /// - // clang-format on - Status DeleteDataSet(std::string const& name, Options opts = {}); - - // clang-format off - /// - /// Delete a [DataSet][google.cloud.timeseriesinsights.v1.DataSet] from the system. - /// - /// **NOTE**: If the [DataSet][google.cloud.timeseriesinsights.v1.DataSet] is still being - /// processed, it will be aborted and deleted. - /// - /// @param request Unary RPCs, such as the one wrapped by this - /// function, receive a single `request` proto message which includes all - /// the inputs for the RPC. In this case, the proto message is a - /// [google.cloud.timeseriesinsights.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 [`Status`] object. If the request failed, the - /// status contains the details of the failure. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// [google.cloud.timeseriesinsights.v1.DeleteDataSetRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L351} - /// - // clang-format on - Status DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request, - Options opts = {}); - - // clang-format off - /// - /// Append events to a `LOADED` [DataSet][google.cloud.timeseriesinsights.v1.DataSet]. - /// - /// @param dataset Required. The DataSet to which we want to append to in the format of - /// "projects/{project}/datasets/{dataset}" - /// @param events Events to be appended. - /// @n - /// Note: - /// @n - /// 0. The [DataSet][google.cloud.timeseriesinsights.v1.DataSet] must be shown in a `LOADED` state - /// in the results of `list` method; otherwise, all events from - /// the append request will be dropped, and a `NOT_FOUND` status will be - /// returned. - /// 0. All events in a single request must have the same - /// [groupId][google.cloud.timeseriesinsights.v1.Event.group_id] if set; otherwise, an - /// `INVALID_ARGUMENT` status will be returned. - /// 0. If [groupId][google.cloud.timeseriesinsights.v1.Event.group_id] is not set (or 0), there - /// should be only 1 event; otherwise, an `INVALID_ARGUMENT` status will be - /// returned. - /// 0. The events must be newer than the current time minus - /// [DataSet TTL][google.cloud.timeseriesinsights.v1.DataSet.ttl] or they will be dropped. - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return the result of the RPC. The response message type - /// ([google.cloud.timeseriesinsights.v1.AppendEventsResponse]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.timeseriesinsights.v1.AppendEventsRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L300} - /// [google.cloud.timeseriesinsights.v1.AppendEventsResponse]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L330} - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// [google.cloud.timeseriesinsights.v1.DataSet.ttl]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L230} - /// [google.cloud.timeseriesinsights.v1.Event.group_id]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L293} - /// - // clang-format on - StatusOr - AppendEvents( - std::string const& dataset, - std::vector const& events, - Options opts = {}); - - // clang-format off - /// - /// Append events to a `LOADED` [DataSet][google.cloud.timeseriesinsights.v1.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.timeseriesinsights.v1.AppendEventsRequest]. - /// Proto messages are converted to C++ classes by Protobuf, using the - /// [Protobuf mapping rules]. - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return the result of the RPC. The response message type - /// ([google.cloud.timeseriesinsights.v1.AppendEventsResponse]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.timeseriesinsights.v1.AppendEventsRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L300} - /// [google.cloud.timeseriesinsights.v1.AppendEventsResponse]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L330} - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// - // clang-format on - StatusOr - AppendEvents( - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// Execute a Timeseries Insights query over a loaded - /// [DataSet][google.cloud.timeseriesinsights.v1.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.timeseriesinsights.v1.QueryDataSetRequest]. - /// Proto messages are converted to C++ classes by Protobuf, using the - /// [Protobuf mapping rules]. - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return the result of the RPC. The response message type - /// ([google.cloud.timeseriesinsights.v1.QueryDataSetResponse]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// [google.cloud.timeseriesinsights.v1.QueryDataSetRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L774} - /// [google.cloud.timeseriesinsights.v1.QueryDataSetResponse]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L831} - /// - // clang-format on - StatusOr - QueryDataSet( - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// Evaluate an explicit slice from a loaded [DataSet][google.cloud.timeseriesinsights.v1.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.timeseriesinsights.v1.EvaluateSliceRequest]. - /// Proto messages are converted to C++ classes by Protobuf, using the - /// [Protobuf mapping rules]. - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return the result of the RPC. The response message type - /// ([google.cloud.timeseriesinsights.v1.EvaluatedSlice]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.timeseriesinsights.v1.DataSet]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L173} - /// [google.cloud.timeseriesinsights.v1.EvaluateSliceRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L844} - /// [google.cloud.timeseriesinsights.v1.EvaluatedSlice]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L499} - /// - // clang-format on - StatusOr EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request, - Options opts = {}); - - // clang-format off - /// - /// Evaluate an explicit timeseries. - /// - /// @param request Unary RPCs, such as the one wrapped by this - /// function, receive a single `request` proto message which includes all - /// the inputs for the RPC. In this case, the proto message is a - /// [google.cloud.timeseriesinsights.v1.EvaluateTimeseriesRequest]. - /// Proto messages are converted to C++ classes by Protobuf, using the - /// [Protobuf mapping rules]. - /// @param opts Optional. Override the class-level options, such as retry and - /// backoff policies. - /// @return the result of the RPC. The response message type - /// ([google.cloud.timeseriesinsights.v1.EvaluatedSlice]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. - /// - /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ - /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator - /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string - /// [`future`]: @ref google::cloud::future - /// [`StatusOr`]: @ref google::cloud::StatusOr - /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.timeseriesinsights.v1.EvaluateTimeseriesRequest]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L874} - /// [google.cloud.timeseriesinsights.v1.EvaluatedSlice]: @googleapis_reference_link{google/cloud/timeseriesinsights/v1/timeseries_insights.proto#L499} - /// - // clang-format on - StatusOr - EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request, - Options opts = {}); - - private: - std::shared_ptr connection_; - Options options_; -}; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CLIENT_H diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.cc b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.cc deleted file mode 100644 index e5a4ce824e34d..0000000000000 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.cc +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_connection_impl.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_option_defaults.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_stub_factory.h" -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_tracing_connection.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_options.h" -#include "google/cloud/background_threads.h" -#include "google/cloud/common_options.h" -#include "google/cloud/credentials.h" -#include "google/cloud/grpc_options.h" -#include "google/cloud/internal/pagination_range.h" -#include "google/cloud/internal/unified_grpc_credentials.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -TimeseriesInsightsControllerConnection:: - ~TimeseriesInsightsControllerConnection() = default; - -StreamRange -TimeseriesInsightsControllerConnection::ListDataSets( - google::cloud::timeseriesinsights::v1:: - ListDataSetsRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - -StatusOr -TimeseriesInsightsControllerConnection::CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -Status TimeseriesInsightsControllerConnection::DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -StatusOr -TimeseriesInsightsControllerConnection::AppendEvents( - google::cloud::timeseriesinsights::v1::AppendEventsRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -StatusOr -TimeseriesInsightsControllerConnection::QueryDataSet( - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -StatusOr -TimeseriesInsightsControllerConnection::EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -StatusOr -TimeseriesInsightsControllerConnection::EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -std::shared_ptr -MakeTimeseriesInsightsControllerConnection(Options options) { - internal::CheckExpectedOptions( - options, __func__); - options = timeseriesinsights_v1_internal:: - TimeseriesInsightsControllerDefaultOptions(std::move(options)); - auto background = internal::MakeBackgroundThreadsFactory(options)(); - auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); - auto stub = timeseriesinsights_v1_internal:: - CreateDefaultTimeseriesInsightsControllerStub(std::move(auth), options); - return timeseriesinsights_v1_internal:: - MakeTimeseriesInsightsControllerTracingConnection( - std::make_shared( - std::move(background), std::move(stub), std::move(options))); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1 -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h deleted file mode 100644 index 69fd5b335f1b0..0000000000000 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_H - -#include "google/cloud/timeseriesinsights/v1/internal/timeseries_insights_controller_retry_traits.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h" -#include "google/cloud/backoff_policy.h" -#include "google/cloud/internal/retry_policy_impl.h" -#include "google/cloud/options.h" -#include "google/cloud/status_or.h" -#include "google/cloud/stream_range.h" -#include "google/cloud/version.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/// The retry policy for `TimeseriesInsightsControllerConnection`. -class TimeseriesInsightsControllerRetryPolicy - : 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 `TimeseriesInsightsControllerConnection` 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 TimeseriesInsightsControllerLimitedErrorCountRetryPolicy - : public TimeseriesInsightsControllerRetryPolicy { - 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 TimeseriesInsightsControllerLimitedErrorCountRetryPolicy( - int maximum_failures) - : impl_(maximum_failures) {} - - TimeseriesInsightsControllerLimitedErrorCountRetryPolicy( - TimeseriesInsightsControllerLimitedErrorCountRetryPolicy&& rhs) noexcept - : TimeseriesInsightsControllerLimitedErrorCountRetryPolicy( - rhs.maximum_failures()) {} - TimeseriesInsightsControllerLimitedErrorCountRetryPolicy( - TimeseriesInsightsControllerLimitedErrorCountRetryPolicy const& - rhs) noexcept - : TimeseriesInsightsControllerLimitedErrorCountRetryPolicy( - 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< - TimeseriesInsightsControllerLimitedErrorCountRetryPolicy>( - maximum_failures()); - } - - // This is provided only for backwards compatibility. - using BaseType = TimeseriesInsightsControllerRetryPolicy; - - private: - google::cloud::internal::LimitedErrorCountRetryPolicy< - timeseriesinsights_v1_internal::TimeseriesInsightsControllerRetryTraits> - impl_; -}; - -/** - * A retry policy for `TimeseriesInsightsControllerConnection` 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 TimeseriesInsightsControllerLimitedTimeRetryPolicy - : public TimeseriesInsightsControllerRetryPolicy { - 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 TimeseriesInsightsControllerLimitedTimeRetryPolicy( - std::chrono::duration maximum_duration) - : impl_(maximum_duration) {} - - TimeseriesInsightsControllerLimitedTimeRetryPolicy( - TimeseriesInsightsControllerLimitedTimeRetryPolicy&& rhs) noexcept - : TimeseriesInsightsControllerLimitedTimeRetryPolicy( - rhs.maximum_duration()) {} - TimeseriesInsightsControllerLimitedTimeRetryPolicy( - TimeseriesInsightsControllerLimitedTimeRetryPolicy const& rhs) noexcept - : TimeseriesInsightsControllerLimitedTimeRetryPolicy( - 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 = TimeseriesInsightsControllerRetryPolicy; - - private: - google::cloud::internal::LimitedTimeRetryPolicy< - timeseriesinsights_v1_internal::TimeseriesInsightsControllerRetryTraits> - impl_; -}; - -/** - * The `TimeseriesInsightsControllerConnection` object for - * `TimeseriesInsightsControllerClient`. - * - * This interface defines virtual methods for each of the user-facing overload - * sets in `TimeseriesInsightsControllerClient`. This allows users to inject - * custom behavior (e.g., with a Google Mock object) when writing tests that use - * objects of type `TimeseriesInsightsControllerClient`. - * - * To create a concrete instance, see - * `MakeTimeseriesInsightsControllerConnection()`. - * - * For mocking, see - * `timeseriesinsights_v1_mocks::MockTimeseriesInsightsControllerConnection`. - */ -class TimeseriesInsightsControllerConnection { - public: - virtual ~TimeseriesInsightsControllerConnection() = 0; - - virtual Options options() { return Options{}; } - - virtual StreamRange - ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request); - - virtual StatusOr - CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request); - - virtual Status DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request); - - virtual StatusOr - AppendEvents(google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request); - - virtual StatusOr - QueryDataSet(google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request); - - virtual StatusOr - EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request); - - virtual StatusOr - EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request); -}; - -/** - * A factory function to construct an object of type - * `TimeseriesInsightsControllerConnection`. - * - * The returned connection object should not be used directly; instead it - * should be passed as an argument to the constructor of - * TimeseriesInsightsControllerClient. - * - * The optional @p options argument may be used to configure aspects of the - * returned `TimeseriesInsightsControllerConnection`. Expected options are any - * of the types in the following option lists: - * - * - `google::cloud::CommonOptionList` - * - `google::cloud::GrpcOptionList` - * - `google::cloud::UnifiedCredentialsOptionList` - * - - * `google::cloud::timeseriesinsights_v1::TimeseriesInsightsControllerPolicyOptionList` - * - * @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 - * `TimeseriesInsightsControllerConnection` created by this function. - */ -std::shared_ptr -MakeTimeseriesInsightsControllerConnection(Options options = {}); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_H diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.cc b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.cc deleted file mode 100644 index 55eb6eeb59c48..0000000000000 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.cc +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h" -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -using ::google::cloud::Idempotency; - -TimeseriesInsightsControllerConnectionIdempotencyPolicy:: - ~TimeseriesInsightsControllerConnectionIdempotencyPolicy() = default; - -std::unique_ptr -TimeseriesInsightsControllerConnectionIdempotencyPolicy::clone() const { - return std::make_unique< - TimeseriesInsightsControllerConnectionIdempotencyPolicy>(*this); -} - -Idempotency -TimeseriesInsightsControllerConnectionIdempotencyPolicy::ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest) { // NOLINT - return Idempotency::kIdempotent; -} - -Idempotency -TimeseriesInsightsControllerConnectionIdempotencyPolicy::CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency -TimeseriesInsightsControllerConnectionIdempotencyPolicy::DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency -TimeseriesInsightsControllerConnectionIdempotencyPolicy::AppendEvents( - google::cloud::timeseriesinsights::v1::AppendEventsRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency -TimeseriesInsightsControllerConnectionIdempotencyPolicy::QueryDataSet( - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency -TimeseriesInsightsControllerConnectionIdempotencyPolicy::EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency -TimeseriesInsightsControllerConnectionIdempotencyPolicy::EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const&) { - return Idempotency::kNonIdempotent; -} - -std::unique_ptr -MakeDefaultTimeseriesInsightsControllerConnectionIdempotencyPolicy() { - return std::make_unique< - TimeseriesInsightsControllerConnectionIdempotencyPolicy>(); -} - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1 -} // namespace cloud -} // namespace google diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h deleted file mode 100644 index 7ae9671c09848..0000000000000 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection_idempotency_policy.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H - -#include "google/cloud/idempotency.h" -#include "google/cloud/version.h" -#include -#include - -namespace google { -namespace cloud { -namespace timeseriesinsights_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -class TimeseriesInsightsControllerConnectionIdempotencyPolicy { - public: - virtual ~TimeseriesInsightsControllerConnectionIdempotencyPolicy(); - - /// Create a new copy of this object. - virtual std::unique_ptr< - TimeseriesInsightsControllerConnectionIdempotencyPolicy> - clone() const; - - virtual google::cloud::Idempotency ListDataSets( - google::cloud::timeseriesinsights::v1::ListDataSetsRequest request); - - virtual google::cloud::Idempotency CreateDataSet( - google::cloud::timeseriesinsights::v1::CreateDataSetRequest const& - request); - - virtual google::cloud::Idempotency DeleteDataSet( - google::cloud::timeseriesinsights::v1::DeleteDataSetRequest const& - request); - - virtual google::cloud::Idempotency AppendEvents( - google::cloud::timeseriesinsights::v1::AppendEventsRequest const& - request); - - virtual google::cloud::Idempotency QueryDataSet( - google::cloud::timeseriesinsights::v1::QueryDataSetRequest const& - request); - - virtual google::cloud::Idempotency EvaluateSlice( - google::cloud::timeseriesinsights::v1::EvaluateSliceRequest const& - request); - - virtual google::cloud::Idempotency EvaluateTimeseries( - google::cloud::timeseriesinsights::v1::EvaluateTimeseriesRequest const& - request); -}; - -std::unique_ptr -MakeDefaultTimeseriesInsightsControllerConnectionIdempotencyPolicy(); - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_options.h b/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_options.h deleted file mode 100644 index 4aed99fad8a81..0000000000000 --- a/google/cloud/timeseriesinsights/v1/timeseries_insights_controller_options.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated by the Codegen C++ plugin. -// If you make any local changes, they will be lost. -// source: google/cloud/timeseriesinsights/v1/timeseries_insights.proto - -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_OPTIONS_H -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_OPTIONS_H - -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_connection.h" -#include "google/cloud/timeseriesinsights/v1/timeseries_insights_controller_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 timeseriesinsights_v1 { -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN - -/** - * Use with `google::cloud::Options` to configure the retry policy. - * - * @ingroup google-cloud-timeseriesinsights-options - */ -struct TimeseriesInsightsControllerRetryPolicyOption { - using Type = std::shared_ptr; -}; - -/** - * Use with `google::cloud::Options` to configure the backoff policy. - * - * @ingroup google-cloud-timeseriesinsights-options - */ -struct TimeseriesInsightsControllerBackoffPolicyOption { - using Type = std::shared_ptr; -}; - -/** - * Use with `google::cloud::Options` to configure which operations are retried. - * - * @ingroup google-cloud-timeseriesinsights-options - */ -struct TimeseriesInsightsControllerConnectionIdempotencyPolicyOption { - using Type = - std::shared_ptr; -}; - -/** - * The options applicable to TimeseriesInsightsController. - * - * @ingroup google-cloud-timeseriesinsights-options - */ -using TimeseriesInsightsControllerPolicyOptionList = - OptionList; - -GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END -} // namespace timeseriesinsights_v1 -} // namespace cloud -} // namespace google - -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_TIMESERIESINSIGHTS_V1_TIMESERIES_INSIGHTS_CONTROLLER_OPTIONS_H