Skip to content

add protocol tests for query compatible, fix protocol tests on mac #3469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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)

file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS
"include/aws/query-compatible-json-rpc-10/*.h"
)

file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS
"include/aws/query-compatible-json-rpc-10/model/*.h"
)

file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_SOURCE
"source/*.cpp"
)

file(GLOB AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_SOURCE
"source/model/*.cpp"
)

file(GLOB QUERY-COMPATIBLE-JSON-RPC-10_UNIFIED_HEADERS
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS}
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS}
)

file(GLOB QUERY-COMPATIBLE-JSON-RPC-10_UNITY_SRC
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_SOURCE}
${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_SOURCE}
)

if(ENABLE_UNITY_BUILD)
enable_unity_build("QUERY-COMPATIBLE-JSON-RPC-10" QUERY-COMPATIBLE-JSON-RPC-10_UNITY_SRC)
endif()

file(GLOB QUERY-COMPATIBLE-JSON-RPC-10_SRC
${QUERY-COMPATIBLE-JSON-RPC-10_UNIFIED_HEADERS}
${QUERY-COMPATIBLE-JSON-RPC-10_UNITY_SRC}
)

if(WIN32)
#if we are compiling for visual studio, create a sane directory tree.
if(MSVC)
source_group("Header Files\\aws\\query-compatible-json-rpc-10" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS})
source_group("Header Files\\aws\\query-compatible-json-rpc-10\\model" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS})
source_group("Source Files" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_SOURCE})
source_group("Source Files\\model" FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_SOURCE})
endif(MSVC)
endif()

set(QUERY-COMPATIBLE-JSON-RPC-10_INCLUDES
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
)

add_library(${PROJECT_NAME} ${QUERY-COMPATIBLE-JSON-RPC-10_SRC})
add_library(AWS::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

set_compiler_flags(${PROJECT_NAME})
set_compiler_warnings(${PROJECT_NAME})

if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS)
target_compile_definitions(${PROJECT_NAME} PRIVATE "AWS_QUERYCOMPATIBLEJSONRPC10_EXPORTS")
endif()

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

target_link_libraries(${PROJECT_NAME} PRIVATE ${PLATFORM_DEP_LIBS} ${PROJECT_LIBS})


setup_install()

install (FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/query-compatible-json-rpc-10)
install (FILES ${AWS_QUERY-COMPATIBLE-JSON-RPC-10_MODEL_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/query-compatible-json-rpc-10/model)

do_packaging()


Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSClient.h>
#include <aws/core/client/AWSClientAsyncCRTP.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10ServiceClientModel.h>

namespace Aws
{
namespace QueryCompatibleJSONRPC10
{
class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10Client : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods<QueryCompatibleJSONRPC10Client>
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
static const char* GetServiceName();
static const char* GetAllocationTag();

typedef QueryCompatibleJSONRPC10ClientConfiguration ClientConfigurationType;
typedef QueryCompatibleJSONRPC10EndpointProvider EndpointProviderType;

/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
QueryCompatibleJSONRPC10Client(const Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration = Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration(),
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> endpointProvider = nullptr);

/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
QueryCompatibleJSONRPC10Client(const Aws::Auth::AWSCredentials& credentials,
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> endpointProvider = nullptr,
const Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration = Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration());

/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
QueryCompatibleJSONRPC10Client(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> endpointProvider = nullptr,
const Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration = Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10ClientConfiguration());


/* Legacy constructors due deprecation */
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
QueryCompatibleJSONRPC10Client(const Aws::Client::ClientConfiguration& clientConfiguration);

/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
QueryCompatibleJSONRPC10Client(const Aws::Auth::AWSCredentials& credentials,
const Aws::Client::ClientConfiguration& clientConfiguration);

/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
QueryCompatibleJSONRPC10Client(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration);

/* End of legacy constructors due deprecation */
virtual ~QueryCompatibleJSONRPC10Client();

/**
*
*/
virtual Model::QueryCompatibleOperationOutcome QueryCompatibleOperation(const Model::QueryCompatibleOperationRequest& request = {}) const;

/**
* A Callable wrapper for QueryCompatibleOperation that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template<typename QueryCompatibleOperationRequestT = Model::QueryCompatibleOperationRequest>
Model::QueryCompatibleOperationOutcomeCallable QueryCompatibleOperationCallable(const QueryCompatibleOperationRequestT& request = {}) const
{
return SubmitCallable(&QueryCompatibleJSONRPC10Client::QueryCompatibleOperation, request);
}

/**
* An Async wrapper for QueryCompatibleOperation that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template<typename QueryCompatibleOperationRequestT = Model::QueryCompatibleOperationRequest>
void QueryCompatibleOperationAsync(const QueryCompatibleOperationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr, const QueryCompatibleOperationRequestT& request = {}) const
{
return SubmitAsync(&QueryCompatibleJSONRPC10Client::QueryCompatibleOperation, request, handler, context);
}


void OverrideEndpoint(const Aws::String& endpoint);
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase>& accessEndpointProvider();
private:
friend class Aws::Client::ClientWithAsyncTemplateMethods<QueryCompatibleJSONRPC10Client>;
void init(const QueryCompatibleJSONRPC10ClientConfiguration& clientConfiguration);

QueryCompatibleJSONRPC10ClientConfiguration m_clientConfiguration;
std::shared_ptr<QueryCompatibleJSONRPC10EndpointProviderBase> m_endpointProvider;
};

} // namespace QueryCompatibleJSONRPC10
} // namespace Aws
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
#include <aws/core/client/GenericClientConfiguration.h>
#include <aws/core/endpoint/DefaultEndpointProvider.h>
#include <aws/core/endpoint/EndpointParameter.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>

#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10EndpointRules.h>


namespace Aws
{
namespace QueryCompatibleJSONRPC10
{
namespace Endpoint
{
using EndpointParameters = Aws::Endpoint::EndpointParameters;
using Aws::Endpoint::EndpointProviderBase;
using Aws::Endpoint::DefaultEndpointProvider;

using QueryCompatibleJSONRPC10ClientContextParameters = Aws::Endpoint::ClientContextParameters;

using QueryCompatibleJSONRPC10ClientConfiguration = Aws::Client::GenericClientConfiguration;
using QueryCompatibleJSONRPC10BuiltInParameters = Aws::Endpoint::BuiltInParameters;

/**
* The type for the QueryCompatibleJSONRPC10 Client Endpoint Provider.
* Inherit from this Base class / "Interface" should you want to provide a custom endpoint provider.
* The SDK must use service-specific type for each service per specification.
*/
using QueryCompatibleJSONRPC10EndpointProviderBase =
EndpointProviderBase<QueryCompatibleJSONRPC10ClientConfiguration, QueryCompatibleJSONRPC10BuiltInParameters, QueryCompatibleJSONRPC10ClientContextParameters>;

using QueryCompatibleJSONRPC10DefaultEpProviderBase =
DefaultEndpointProvider<QueryCompatibleJSONRPC10ClientConfiguration, QueryCompatibleJSONRPC10BuiltInParameters, QueryCompatibleJSONRPC10ClientContextParameters>;

/**
* Default endpoint provider used for this service
*/
class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10EndpointProvider : public QueryCompatibleJSONRPC10DefaultEpProviderBase
{
public:
using QueryCompatibleJSONRPC10ResolveEndpointOutcome = Aws::Endpoint::ResolveEndpointOutcome;

QueryCompatibleJSONRPC10EndpointProvider()
: QueryCompatibleJSONRPC10DefaultEpProviderBase(Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10EndpointRules::GetRulesBlob(), Aws::QueryCompatibleJSONRPC10::QueryCompatibleJSONRPC10EndpointRules::RulesBlobSize)
{}

~QueryCompatibleJSONRPC10EndpointProvider()
{
}
};
} // namespace Endpoint
} // namespace QueryCompatibleJSONRPC10
} // namespace Aws
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <cstddef>
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>

namespace Aws
{
namespace QueryCompatibleJSONRPC10
{
class QueryCompatibleJSONRPC10EndpointRules
{
public:
static const size_t RulesBlobStrLen;
static const size_t RulesBlobSize;

static const char* GetRulesBlob();
};
} // namespace QueryCompatibleJSONRPC10
} // namespace Aws
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once

#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>

namespace Aws
{
namespace Client
{

class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10ErrorMarshaller : public Aws::Client::JsonErrorMarshallerQueryCompatible
{
public:
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
};

} // namespace Client
} // namespace Aws
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once

#include <aws/core/client/AWSError.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/query-compatible-json-rpc-10/QueryCompatibleJSONRPC10_EXPORTS.h>

namespace Aws
{
namespace QueryCompatibleJSONRPC10
{
enum class QueryCompatibleJSONRPC10Errors
{
//From Core//
//////////////////////////////////////////////////////////////////////////////////////////
INCOMPLETE_SIGNATURE = 0,
INTERNAL_FAILURE = 1,
INVALID_ACTION = 2,
INVALID_CLIENT_TOKEN_ID = 3,
INVALID_PARAMETER_COMBINATION = 4,
INVALID_QUERY_PARAMETER = 5,
INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
OPT_IN_REQUIRED = 10,
REQUEST_EXPIRED = 11,
SERVICE_UNAVAILABLE = 12,
THROTTLING = 13,
VALIDATION = 14,
ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16,
UNRECOGNIZED_CLIENT = 17,
MALFORMED_QUERY_STRING = 18,
SLOW_DOWN = 19,
REQUEST_TIME_TOO_SKEWED = 20,
INVALID_SIGNATURE = 21,
SIGNATURE_DOES_NOT_MATCH = 22,
INVALID_ACCESS_KEY_ID = 23,
REQUEST_TIMEOUT = 24,
NETWORK_CONNECTION = 99,

UNKNOWN = 100,
///////////////////////////////////////////////////////////////////////////////////////////

CUSTOM_CODE= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
NO_CUSTOM_CODE
};

class AWS_QUERYCOMPATIBLEJSONRPC10_API QueryCompatibleJSONRPC10Error : public Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>
{
public:
QueryCompatibleJSONRPC10Error() {}
QueryCompatibleJSONRPC10Error(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}
QueryCompatibleJSONRPC10Error(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}
QueryCompatibleJSONRPC10Error(const Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}
QueryCompatibleJSONRPC10Error(Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>&& rhs) : Aws::Client::AWSError<QueryCompatibleJSONRPC10Errors>(rhs) {}

template <typename T>
T GetModeledError();
};

namespace QueryCompatibleJSONRPC10ErrorMapper
{
AWS_QUERYCOMPATIBLEJSONRPC10_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}

} // namespace QueryCompatibleJSONRPC10
} // namespace Aws
Loading