Skip to content

Commit 21014ad

Browse files
committed
add protocol tests for query compatible, fix protocol tests on mac
1 parent 1361161 commit 21014ad

File tree

72 files changed

+1623
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1623
-139
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
add_project(aws-cpp-sdk-query-compatible-json-rpc-10 "C++ SDK for the AWS query-compatible-json-rpc-10 service" aws-cpp-sdk-core)
2+
3+
file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS
4+
"include/aws/query-compatible-json-rpc-10/*.h"
5+
)
6+
7+
file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS
8+
"include/aws/query-compatible-json-rpc-10/model/*.h"
9+
)
10+
11+
file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_SOURCE
12+
"source/*.cpp"
13+
)
14+
15+
file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_SOURCE
16+
"source/model/*.cpp"
17+
)
18+
19+
file(GLOB QUERY-COMPATIBLE-JSON-RPC-10_UNIFIED_HEADERS
20+
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS}
21+
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS}
22+
)
23+
24+
file(GLOB QUERY-COMPATIBLE-JSON-RPC-10_UNITY_SRC
25+
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_SOURCE}
26+
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_SOURCE}
27+
)
28+
29+
if(ENABLE_UNITY_BUILD)
30+
enable_unity_build("QUERY-COMPATIBLE-JSON-RPC-10" QUERY-COMPATIBLE-JSON-RPC-10_UNITY_SRC)
31+
endif()
32+
33+
file(GLOB QUERY-COMPATIBLE-JSON-RPC-10_SRC
34+
${QUERY-COMPATIBLE-JSON-RPC-10_UNIFIED_HEADERS}
35+
${QUERY-COMPATIBLE-JSON-RPC-10_UNITY_SRC}
36+
)
37+
38+
if(WIN32)
39+
#if we are compiling for visual studio, create a sane directory tree.
40+
if(MSVC)
41+
source_group("Header Files\\aws\\query-compatible-json-rpc-10" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS})
42+
source_group("Header Files\\aws\\query-compatible-json-rpc-10\\model" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS})
43+
source_group("Source Files" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_SOURCE})
44+
source_group("Source Files\\model" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_SOURCE})
45+
endif(MSVC)
46+
endif()
47+
48+
set(QUERY-COMPATIBLE-JSON-RPC-10_INCLUDES
49+
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
50+
)
51+
52+
add_library(${PROJECT_NAME} ${QUERY-COMPATIBLE-JSON-RPC-10_SRC})
53+
add_library(AWS::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
54+
55+
set_compiler_flags(${PROJECT_NAME})
56+
set_compiler_warnings(${PROJECT_NAME})
57+
58+
if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS)
59+
target_compile_definitions(${PROJECT_NAME} PRIVATE "AWS_QUERYCOMPATIBLEJSONRPC10_EXPORTS")
60+
endif()
61+
62+
target_include_directories(${PROJECT_NAME} PUBLIC
63+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
64+
$<INSTALL_INTERFACE:include>)
65+
66+
target_link_libraries(${PROJECT_NAME} PRIVATE ${PLATFORM_DEP_LIBS} ${PROJECT_LIBS})
67+
68+
69+
setup_install()
70+
71+
install (FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/query-compatible-json-rpc-10)
72+
install (FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/query-compatible-json-rpc-10/model)
73+
74+
do_packaging()
75+
76+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
8+
#include <aws/core/client/ClientConfiguration.h>
9+
#include <aws/core/client/AWSClient.h>
10+
#include <aws/core/client/AWSClientAsyncCRTP.h>
11+
#include <aws/core/utils/json/JsonSerializer.h>
12+
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10ServiceClientModel.h>
13+
14+
namespace Aws
15+
{
16+
namespace QueryCompatibleJSONRPC10
17+
{
18+
class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10Client : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods<QueryCompatibleJSONRPC10Client>
19+
{
20+
public:
21+
typedef Aws::Client::AWSJsonClient BASECLASS;
22+
static const char* GetServiceName();
23+
static const char* GetAllocationTag();
24+
25+
typedef QueryCompatibleJSONRPC10ClientConfiguration ClientConfigurationType;
26+
typedef QueryCompatibleJSONRPC10EndpointProvider EndpointProviderType;
27+
28+
/**
29+
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
30+
* is not specified, it will be initialized to default values.
31+
*/
32+
QueryCompatibleJSONRPC10Client(const Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration = Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration(),
33+
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> endpointProvider = nullptr);
34+
35+
/**
36+
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
37+
* is not specified, it will be initialized to default values.
38+
*/
39+
QueryCompatibleJSONRPC10Client(const Aws::Auth::AWSCredentials& credentials,
40+
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> endpointProvider = nullptr,
41+
const Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration = Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration());
42+
43+
/**
44+
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
45+
* the default http client factory will be used
46+
*/
47+
QueryCompatibleJSONRPC10Client(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
48+
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> endpointProvider = nullptr,
49+
const Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration = Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration());
50+
51+
52+
/* Legacy constructors due deprecation */
53+
/**
54+
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
55+
* is not specified, it will be initialized to default values.
56+
*/
57+
QueryCompatibleJSONRPC10Client(const Aws::Client::ClientConfiguration& clientConfiguration);
58+
59+
/**
60+
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
61+
* is not specified, it will be initialized to default values.
62+
*/
63+
QueryCompatibleJSONRPC10Client(const Aws::Auth::AWSCredentials& credentials,
64+
const Aws::Client::ClientConfiguration& clientConfiguration);
65+
66+
/**
67+
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
68+
* the default http client factory will be used
69+
*/
70+
QueryCompatibleJSONRPC10Client(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
71+
const Aws::Client::ClientConfiguration& clientConfiguration);
72+
73+
/* End of legacy constructors due deprecation */
74+
virtual ~QueryCompatibleJSONRPC10Client();
75+
76+
/**
77+
*
78+
*/
79+
virtual Model::QueryCompatibleOperationOutcome QueryCompatibleOperation(const Model::QueryCompatibleOperationRequest& request = {}) const;
80+
81+
/**
82+
* A Callable wrapper for QueryCompatibleOperation that returns a future to the operation so that it can be executed in parallel to other requests.
83+
*/
84+
template<typename QueryCompatibleOperationRequestT = Model::QueryCompatibleOperationRequest>
85+
Model::QueryCompatibleOperationOutcomeCallable QueryCompatibleOperationCallable(const QueryCompatibleOperationRequestT& request = {}) const
86+
{
87+
return SubmitCallable(&QueryCompatibleJSONRPC10Client::QueryCompatibleOperation, request);
88+
}
89+
90+
/**
91+
* An Async wrapper for QueryCompatibleOperation that queues the request into a thread executor and triggers associated callback when operation has finished.
92+
*/
93+
template<typename QueryCompatibleOperationRequestT = Model::QueryCompatibleOperationRequest>
94+
void QueryCompatibleOperationAsync(const QueryCompatibleOperationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr, const QueryCompatibleOperationRequestT& request = {}) const
95+
{
96+
return SubmitAsync(&QueryCompatibleJSONRPC10Client::QueryCompatibleOperation, request, handler, context);
97+
}
98+
99+
100+
void OverrideEndpoint(const Aws::String& endpoint);
101+
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase>& accessEndpointProvider();
102+
private:
103+
friend class Aws::Client::ClientWithAsyncTemplateMethods<QueryCompatibleJSONRPC10Client>;
104+
void init(const QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration);
105+
106+
QueryCompatibleJSONRPC10ClientConfiguration m_clientConfiguration;
107+
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> m_endpointProvider;
108+
};
109+
110+
} // namespace QueryCompatibleJSONRPC10
111+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
8+
#include <aws/core/client/GenericClientConfiguration.h>
9+
#include <aws/core/endpoint/DefaultEndpointProvider.h>
10+
#include <aws/core/endpoint/EndpointParameter.h>
11+
#include <aws/core/utils/memory/stl/AWSString.h>
12+
#include <aws/core/utils/memory/stl/AWSVector.h>
13+
14+
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10EndpointRules.h>
15+
16+
17+
namespace Aws
18+
{
19+
namespace QueryCompatibleJSONRPC10
20+
{
21+
namespace Endpoint
22+
{
23+
using EndpointParameters = Aws::Endpoint::EndpointParameters;
24+
using Aws::Endpoint::EndpointProviderBase;
25+
using Aws::Endpoint::DefaultEndpointProvider;
26+
27+
using QueryCompatibleJSONRPC10ClientContextParameters = Aws::Endpoint::ClientContextParameters;
28+
29+
using QueryCompatibleJSONRPC10ClientConfiguration = Aws::Client::GenericClientConfiguration;
30+
using QueryCompatibleJSONRPC10BuiltInParameters = Aws::Endpoint::BuiltInParameters;
31+
32+
/**
33+
* The type for the QueryCompatibleJSONRPC10 Client Endpoint Provider.
34+
* Inherit from this Base class / "Interface" should you want to provide a custom endpoint provider.
35+
* The SDK must use service-specific type for each service per specification.
36+
*/
37+
using QueryCompatibleJSONRPC10EndpointProviderBase =
38+
EndpointProviderBase<QueryCompatibleJSONRPC10ClientConfiguration, QueryCompatibleJSONRPC10BuiltInParameters, QueryCompatibleJSONRPC10ClientContextParameters>;
39+
40+
using QueryCompatibleJSONRPC10DefaultEpProviderBase =
41+
DefaultEndpointProvider<QueryCompatibleJSONRPC10ClientConfiguration, QueryCompatibleJSONRPC10BuiltInParameters, QueryCompatibleJSONRPC10ClientContextParameters>;
42+
43+
/**
44+
* Default endpoint provider used for this service
45+
*/
46+
class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10EndpointProvider : public QueryCompatibleJSONRPC10DefaultEpProviderBase
47+
{
48+
public:
49+
using QueryCompatibleJSONRPC10ResolveEndpointOutcome = Aws::Endpoint::ResolveEndpointOutcome;
50+
51+
QueryCompatibleJSONRPC10EndpointProvider()
52+
: QueryCompatibleJSONRPC10DefaultEpProviderBase(Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10EndpointRules::GetRulesBlob(), Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10EndpointRules::RulesBlobSize)
53+
{}
54+
55+
~QueryCompatibleJSONRPC10EndpointProvider()
56+
{
57+
}
58+
};
59+
} // namespace Endpoint
60+
} // namespace QueryCompatibleJSONRPC10
61+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
#include <cstddef>
8+
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
9+
10+
namespace Aws
11+
{
12+
namespace QueryCompatibleJSONRPC10
13+
{
14+
class QueryCompatibleJSONRPC10EndpointRules
15+
{
16+
public:
17+
static const size_t RulesBlobStrLen;
18+
static const size_t RulesBlobSize;
19+
20+
static const char* GetRulesBlob();
21+
};
22+
} // namespace QueryCompatibleJSONRPC10
23+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
8+
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
9+
#include <aws/core/client/AWSErrorMarshaller.h>
10+
11+
namespace Aws
12+
{
13+
namespace Client
14+
{
15+
16+
class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10ErrorMarshaller : public Aws::Client::JsonErrorMarshallerQueryCompatible
17+
{
18+
public:
19+
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
20+
};
21+
22+
} // namespace Client
23+
} // namespace Aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
#pragma once
7+
8+
#include <aws/core/client/AWSError.h>
9+
#include <aws/core/client/CoreErrors.h>
10+
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
11+
12+
namespace Aws
13+
{
14+
namespace QueryCompatibleJSONRPC10
15+
{
16+
enum class QueryCompatibleJSONRPC10Errors
17+
{
18+
//From Core//
19+
//////////////////////////////////////////////////////////////////////////////////////////
20+
INCOMPLETE_SIGNATURE = 0,
21+
INTERNAL_FAILURE = 1,
22+
INVALID_ACTION = 2,
23+
INVALID_CLIENT_TOKEN_ID = 3,
24+
INVALID_PARAMETER_COMBINATION = 4,
25+
INVALID_QUERY_PARAMETER = 5,
26+
INVALID_PARAMETER_VALUE = 6,
27+
MISSING_ACTION = 7, // SDK should never allow
28+
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
29+
MISSING_PARAMETER = 9, // SDK should never allow
30+
OPT_IN_REQUIRED = 10,
31+
REQUEST_EXPIRED = 11,
32+
SERVICE_UNAVAILABLE = 12,
33+
THROTTLING = 13,
34+
VALIDATION = 14,
35+
ACCESS_DENIED = 15,
36+
RESOURCE_NOT_FOUND = 16,
37+
UNRECOGNIZED_CLIENT = 17,
38+
MALFORMED_QUERY_STRING = 18,
39+
SLOW_DOWN = 19,
40+
REQUEST_TIME_TOO_SKEWED = 20,
41+
INVALID_SIGNATURE = 21,
42+
SIGNATURE_DOES_NOT_MATCH = 22,
43+
INVALID_ACCESS_KEY_ID = 23,
44+
REQUEST_TIMEOUT = 24,
45+
NETWORK_CONNECTION = 99,
46+
47+
UNKNOWN = 100,
48+
///////////////////////////////////////////////////////////////////////////////////////////
49+
50+
CUSTOM_CODE= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
51+
NO_CUSTOM_CODE
52+
};
53+
54+
class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10Error : public Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>
55+
{
56+
public:
57+
QueryCompatibleJSONRPC10Error() {}
58+
QueryCompatibleJSONRPC10Error(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}
59+
QueryCompatibleJSONRPC10Error(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}
60+
QueryCompatibleJSONRPC10Error(const Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}
61+
QueryCompatibleJSONRPC10Error(Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>&& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}
62+
63+
template <typename T>
64+
T GetModeledError();
65+
};
66+
67+
namespace QueryCompatibleJSONRPC10ErrorMapper
68+
{
69+
AWS_QUERYCOMPATIBLEJSONRPC10_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
70+
}
71+
72+
} // namespace QueryCompatibleJSONRPC10
73+
} // namespace Aws

0 commit comments

Comments
 (0)