-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathAwsLegacyClient.h
More file actions
106 lines (99 loc) · 4.5 KB
/
AwsLegacyClient.h
File metadata and controls
106 lines (99 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/core/AmazonWebServiceRequest.h>
#include <aws/core/endpoint/AWSEndpoint.h>
namespace smithy {
namespace client
{
/*
This Class exists only to provide a way to access the legacy client APIs
*/
template<const char* ServiceNameT,
typename ResponseT,
typename DerivedT>
class AwsLegacyClientT
{
protected:
ResponseT MakeRequest(const Aws::Http::URI& uri,
const Aws::AmazonWebServiceRequest& request,
Aws::Http::HttpMethod method = Aws::Http::HttpMethod::HTTP_POST,
const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const
{
AWS_UNREFERENCED_PARAM(uri);
AWS_UNREFERENCED_PARAM(signerName);
AWS_UNREFERENCED_PARAM(signerRegionOverride);
AWS_UNREFERENCED_PARAM(signerServiceNameOverride);
AWS_LOGSTREAM_WARN(ServiceNameT, "Using Deprecated API. Please use appropriate client constructor");
auto endpointCallback = [](const Aws::Endpoint::AWSEndpoint& ) {
};
return static_cast<const DerivedT*>(this)->MakeRequestDeserialize(&request,
ServiceNameT,
method,
std::move(endpointCallback));
}
ResponseT MakeRequest(const Aws::Http::URI& uri,
Aws::Http::HttpMethod method = Aws::Http::HttpMethod::HTTP_POST,
const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* requestName = "",
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const
{
AWS_UNREFERENCED_PARAM(uri);
AWS_UNREFERENCED_PARAM(signerName);
AWS_UNREFERENCED_PARAM(signerRegionOverride);
AWS_UNREFERENCED_PARAM(signerServiceNameOverride);
AWS_LOGSTREAM_WARN(ServiceNameT, "Using Deprecated API. Please use appropriate client constructor");
auto endpointCallback = [](const Aws::Endpoint::AWSEndpoint& ) {
};
return static_cast<const DerivedT*>(this)->MakeRequestDeserialize(nullptr,
requestName,
method,
std::move(endpointCallback));
}
ResponseT MakeRequest(const Aws::AmazonWebServiceRequest& request,
const Aws::Endpoint::AWSEndpoint& endpoint,
Aws::Http::HttpMethod method = Aws::Http::HttpMethod::HTTP_POST,
const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const
{
AWS_UNREFERENCED_PARAM(endpoint);
AWS_UNREFERENCED_PARAM(signerName);
AWS_UNREFERENCED_PARAM(signerRegionOverride);
AWS_UNREFERENCED_PARAM(signerServiceNameOverride);
AWS_LOGSTREAM_WARN(ServiceNameT, "Using Deprecated API. Please use appropriate client constructor");
auto endpointCallback = [](const Aws::Endpoint::AWSEndpoint& ) {
};
return static_cast<const DerivedT*>(this)->MakeRequestDeserialize(&request,
ServiceNameT,
method,
std::move(endpointCallback));
}
ResponseT MakeRequest(const Aws::Endpoint::AWSEndpoint& endpoint,
const char* requestName = "",
Aws::Http::HttpMethod method = Aws::Http::HttpMethod::HTTP_POST,
const char* signerName = Aws::Auth::SIGV4_SIGNER,
const char* signerRegionOverride = nullptr,
const char* signerServiceNameOverride = nullptr) const
{
AWS_UNREFERENCED_PARAM(endpoint);
AWS_UNREFERENCED_PARAM(signerName);
AWS_UNREFERENCED_PARAM(signerRegionOverride);
AWS_UNREFERENCED_PARAM(signerServiceNameOverride);
AWS_LOGSTREAM_WARN(ServiceNameT, "Using Deprecated API. Please use appropriate client constructor");
auto endpointCallback = [](const Aws::Endpoint::AWSEndpoint& ) {
};
return static_cast<const DerivedT*>(this)->MakeRequestDeserialize(nullptr,
requestName,
method,
std::move(endpointCallback));
}
AwsLegacyClientT() = default;
};
} // namespace client
} // namespace smithy