azure-core
client_options.hpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 
10 #pragma once
11 
12 #include "azure/core/http/http.hpp"
14 
15 #include <memory>
16 #include <vector>
17 
18 namespace Azure { namespace Core { namespace _internal {
19 
24  struct ClientOptions
25  {
30  virtual ~ClientOptions() = default;
31 
36  std::vector<std::unique_ptr<Azure::Core::Http::Policies::HttpPolicy>> PerOperationPolicies;
37 
42  std::vector<std::unique_ptr<Azure::Core::Http::Policies::HttpPolicy>> PerRetryPolicies;
43 
48  ClientOptions(ClientOptions&&) = default;
49 
54  ClientOptions(ClientOptions const& other) { *this = other; }
55 
56  ClientOptions() = default;
57 
62  ClientOptions& operator=(ClientOptions&&) = default;
63 
68  ClientOptions& operator=(const ClientOptions& other)
69  {
70  this->Retry = other.Retry;
71  this->Transport = other.Transport;
72  this->Telemetry = other.Telemetry;
73  this->Log = other.Log;
74  this->PerOperationPolicies.reserve(other.PerOperationPolicies.size());
75  for (auto& policy : other.PerOperationPolicies)
76  {
77  this->PerOperationPolicies.emplace_back(policy->Clone());
78  }
79  this->PerRetryPolicies.reserve(other.PerRetryPolicies.size());
80  for (auto& policy : other.PerRetryPolicies)
81  {
82  this->PerRetryPolicies.emplace_back(policy->Clone());
83  }
84  return *this;
85  }
86 
92 
98 
104 
110  };
111 
112 }}} // namespace Azure::Core::_internal
Azure::Core::Http::Policies::TransportOptions
HTTP transport options parameterize the HTTP transport adapter being used.
Definition: policy.hpp:136
Azure::Core::Http::Policies::RetryOptions
The set of options that can be specified to influence how retry attempts are made,...
Definition: policy.hpp:78
Azure::Core::Http::Policies::LogOptions
Log options that parameterize the information being logged.
Definition: policy.hpp:118
policy.hpp
HTTP transport policies, and their options.
Azure
Azure SDK abstractions.
Definition: azure_assert.hpp:55
http.hpp
HTTP request and response functionality.
Azure::Core::Http::Policies::TelemetryOptions
Telemetry options, used to configure telemetry parameters.
Definition: policy.hpp:53