|
| 1 | +// Copyright 2023 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_INTERNAL_PROJECT_OPTIONS_H |
| 16 | +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_INTERNAL_PROJECT_OPTIONS_H |
| 17 | + |
| 18 | +#include "google/cloud/bigquery/v2/minimal/internal/project_idempotency_policy.h" |
| 19 | +#include "google/cloud/bigquery/v2/minimal/internal/project_retry_policy.h" |
| 20 | +#include "google/cloud/backoff_policy.h" |
| 21 | +#include "google/cloud/options.h" |
| 22 | +#include "google/cloud/version.h" |
| 23 | +#include <memory> |
| 24 | + |
| 25 | +namespace google { |
| 26 | +namespace cloud { |
| 27 | +namespace bigquery_v2_minimal_internal { |
| 28 | +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN |
| 29 | + |
| 30 | +/** |
| 31 | + * Use with `google::cloud::Options` to configure the retry policy. |
| 32 | + */ |
| 33 | +struct ProjectRetryPolicyOption { |
| 34 | + using Type = std::shared_ptr<ProjectRetryPolicy>; |
| 35 | +}; |
| 36 | + |
| 37 | +/** |
| 38 | + * Use with `google::cloud::Options` to configure the backoff policy. |
| 39 | + */ |
| 40 | +struct ProjectBackoffPolicyOption { |
| 41 | + using Type = std::shared_ptr<BackoffPolicy>; |
| 42 | +}; |
| 43 | + |
| 44 | +/** |
| 45 | + * Use with `google::cloud::Options` to configure which operations are retried. |
| 46 | + */ |
| 47 | +struct ProjectIdempotencyPolicyOption { |
| 48 | + using Type = std::shared_ptr<ProjectIdempotencyPolicy>; |
| 49 | +}; |
| 50 | + |
| 51 | +/** |
| 52 | + * Use with `google::cloud::Options` to configure the connection pool size for |
| 53 | + * rest client. |
| 54 | + */ |
| 55 | +struct ProjectConnectionPoolSizeOption { |
| 56 | + using Type = std::size_t; |
| 57 | +}; |
| 58 | + |
| 59 | +/** |
| 60 | + * The options applicable to Project. |
| 61 | + */ |
| 62 | +using ProjectPolicyOptionList = |
| 63 | + OptionList<ProjectRetryPolicyOption, ProjectBackoffPolicyOption, |
| 64 | + ProjectIdempotencyPolicyOption, ProjectConnectionPoolSizeOption>; |
| 65 | + |
| 66 | +/** |
| 67 | + * Default options for Project. |
| 68 | + */ |
| 69 | +Options ProjectDefaultOptions(Options options); |
| 70 | + |
| 71 | +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END |
| 72 | +} // namespace bigquery_v2_minimal_internal |
| 73 | +} // namespace cloud |
| 74 | +} // namespace google |
| 75 | + |
| 76 | +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_INTERNAL_PROJECT_OPTIONS_H |
0 commit comments