aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/endpoint/ClientContextParameters.cpp
diff options
context:
space:
mode:
authordakovalkov <dakovalkov@yandex-team.com>2023-12-03 13:33:55 +0300
committerdakovalkov <dakovalkov@yandex-team.com>2023-12-03 14:04:39 +0300
commit2a718325637e5302334b6d0a6430f63168f8dbb3 (patch)
tree64be81080b7df9ec1d86d053a0c394ae53fcf1fe /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/endpoint/ClientContextParameters.cpp
parente0d94a470142d95c3007e9c5d80380994940664a (diff)
downloadydb-2a718325637e5302334b6d0a6430f63168f8dbb3.tar.gz
Update contrib/libs/aws-sdk-cpp to 1.11.37
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/endpoint/ClientContextParameters.cpp')
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/endpoint/ClientContextParameters.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/endpoint/ClientContextParameters.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/endpoint/ClientContextParameters.cpp
new file mode 100644
index 0000000000..cdff71f669
--- /dev/null
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/endpoint/ClientContextParameters.cpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
+
+#include <aws/core/endpoint/ClientContextParameters.h>
+
+namespace Aws
+{
+namespace Endpoint
+{
+ const ClientContextParameters::EndpointParameter& ClientContextParameters::GetParameter(const Aws::String& name) const
+ {
+ const auto foundIt = std::find_if(m_params.begin(), m_params.end(),
+ [name](const ClientContextParameters::EndpointParameter& item)
+ {
+ return item.GetName() == name;
+ });
+
+ if (foundIt != m_params.end())
+ {
+ return *foundIt;
+ }
+ else
+ {
+ static const ClientContextParameters::EndpointParameter CTX_NOT_FOUND_PARAMETER("PARAMETER_NOT_SET", false, EndpointParameter::ParameterOrigin::CLIENT_CONTEXT);
+ return CTX_NOT_FOUND_PARAMETER;
+ }
+ }
+
+ void ClientContextParameters::SetParameter(EndpointParameter param)
+ {
+ const auto foundIt = std::find_if(m_params.begin(), m_params.end(),
+ [param](const ClientContextParameters::EndpointParameter& item)
+ {
+ return item.GetName() == param.GetName();
+ });
+
+ if (foundIt != m_params.end())
+ {
+ m_params.erase(foundIt);
+ }
+ m_params.emplace_back(std::move(param));
+ }
+
+ void ClientContextParameters::SetStringParameter(Aws::String name, Aws::String value)
+ {
+ return SetParameter(EndpointParameter(std::move(name), std::move(value), EndpointParameter::ParameterOrigin::CLIENT_CONTEXT));
+ }
+
+ void ClientContextParameters::SetBooleanParameter(Aws::String name, bool value)
+ {
+ return SetParameter(EndpointParameter(std::move(name), value, EndpointParameter::ParameterOrigin::CLIENT_CONTEXT));
+ }
+
+ const Aws::Vector<ClientContextParameters::EndpointParameter>& ClientContextParameters::GetAllParameters() const
+ {
+ return m_params;
+ }
+} // namespace Endpoint
+} // namespace Aws \ No newline at end of file