feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,76 @@
add_project(aws-cpp-sdk-ebs "C++ SDK for the AWS ebs service" aws-cpp-sdk-core)
file(GLOB AWS_EBS_HEADERS
"include/aws/ebs/*.h"
)
file(GLOB AWS_EBS_MODEL_HEADERS
"include/aws/ebs/model/*.h"
)
file(GLOB AWS_EBS_SOURCE
"source/*.cpp"
)
file(GLOB AWS_EBS_MODEL_SOURCE
"source/model/*.cpp"
)
file(GLOB EBS_UNIFIED_HEADERS
${AWS_EBS_HEADERS}
${AWS_EBS_MODEL_HEADERS}
)
file(GLOB EBS_UNITY_SRC
${AWS_EBS_SOURCE}
${AWS_EBS_MODEL_SOURCE}
)
if(ENABLE_UNITY_BUILD)
enable_unity_build("EBS" EBS_UNITY_SRC)
endif()
file(GLOB EBS_SRC
${EBS_UNIFIED_HEADERS}
${EBS_UNITY_SRC}
)
if(WIN32)
#if we are compiling for visual studio, create a sane directory tree.
if(MSVC)
source_group("Header Files\\aws\\ebs" FILES ${AWS_EBS_HEADERS})
source_group("Header Files\\aws\\ebs\\model" FILES ${AWS_EBS_MODEL_HEADERS})
source_group("Source Files" FILES ${AWS_EBS_SOURCE})
source_group("Source Files\\model" FILES ${AWS_EBS_MODEL_SOURCE})
endif(MSVC)
endif()
set(EBS_INCLUDES
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
)
add_library(${PROJECT_NAME} ${EBS_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_EBS_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_EBS_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/ebs)
install (FILES ${AWS_EBS_MODEL_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/ebs/model)
do_packaging()

View File

@@ -0,0 +1,350 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/EBSErrors.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSClient.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/ebs/model/CompleteSnapshotResult.h>
#include <aws/ebs/model/GetSnapshotBlockResult.h>
#include <aws/ebs/model/ListChangedBlocksResult.h>
#include <aws/ebs/model/ListSnapshotBlocksResult.h>
#include <aws/ebs/model/PutSnapshotBlockResult.h>
#include <aws/ebs/model/StartSnapshotResult.h>
#include <aws/core/client/AsyncCallerContext.h>
#include <aws/core/http/HttpTypes.h>
#include <future>
#include <functional>
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace EBS
{
namespace Model
{
class CompleteSnapshotRequest;
class GetSnapshotBlockRequest;
class ListChangedBlocksRequest;
class ListSnapshotBlocksRequest;
class PutSnapshotBlockRequest;
class StartSnapshotRequest;
typedef Aws::Utils::Outcome<CompleteSnapshotResult, EBSError> CompleteSnapshotOutcome;
typedef Aws::Utils::Outcome<GetSnapshotBlockResult, EBSError> GetSnapshotBlockOutcome;
typedef Aws::Utils::Outcome<ListChangedBlocksResult, EBSError> ListChangedBlocksOutcome;
typedef Aws::Utils::Outcome<ListSnapshotBlocksResult, EBSError> ListSnapshotBlocksOutcome;
typedef Aws::Utils::Outcome<PutSnapshotBlockResult, EBSError> PutSnapshotBlockOutcome;
typedef Aws::Utils::Outcome<StartSnapshotResult, EBSError> StartSnapshotOutcome;
typedef std::future<CompleteSnapshotOutcome> CompleteSnapshotOutcomeCallable;
typedef std::future<GetSnapshotBlockOutcome> GetSnapshotBlockOutcomeCallable;
typedef std::future<ListChangedBlocksOutcome> ListChangedBlocksOutcomeCallable;
typedef std::future<ListSnapshotBlocksOutcome> ListSnapshotBlocksOutcomeCallable;
typedef std::future<PutSnapshotBlockOutcome> PutSnapshotBlockOutcomeCallable;
typedef std::future<StartSnapshotOutcome> StartSnapshotOutcomeCallable;
} // namespace Model
class EBSClient;
typedef std::function<void(const EBSClient*, const Model::CompleteSnapshotRequest&, const Model::CompleteSnapshotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CompleteSnapshotResponseReceivedHandler;
typedef std::function<void(const EBSClient*, const Model::GetSnapshotBlockRequest&, Model::GetSnapshotBlockOutcome, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetSnapshotBlockResponseReceivedHandler;
typedef std::function<void(const EBSClient*, const Model::ListChangedBlocksRequest&, const Model::ListChangedBlocksOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListChangedBlocksResponseReceivedHandler;
typedef std::function<void(const EBSClient*, const Model::ListSnapshotBlocksRequest&, const Model::ListSnapshotBlocksOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListSnapshotBlocksResponseReceivedHandler;
typedef std::function<void(const EBSClient*, const Model::PutSnapshotBlockRequest&, const Model::PutSnapshotBlockOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutSnapshotBlockResponseReceivedHandler;
typedef std::function<void(const EBSClient*, const Model::StartSnapshotRequest&, const Model::StartSnapshotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartSnapshotResponseReceivedHandler;
/**
* <p>You can use the Amazon Elastic Block Store (EBS) direct APIs to directly read
* the data on your EBS snapshots, and identify the difference between two
* snapshots. You can view the details of blocks in an EBS snapshot, compare the
* block difference between two snapshots, and directly access the data in a
* snapshot. If you're an independent software vendor (ISV) who offers backup
* services for EBS, the EBS direct APIs make it easier and more cost-effective to
* track incremental changes on your EBS volumes via EBS snapshots. This can be
* done without having to create new volumes from EBS snapshots.</p> <p>This API
* reference provides detailed information about the actions, data types,
* parameters, and errors of the EBS direct APIs. For more information about the
* elements that make up the EBS direct APIs, and examples of how to use them
* effectively, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html">Accessing
* the Contents of an EBS Snapshot</a> in the <i>Amazon Elastic Compute Cloud User
* Guide</i>. For more information about the supported AWS Regions, endpoints, and
* service quotas for the EBS direct APIs, see <a
* href="https://docs.aws.amazon.com/general/latest/gr/ebs-service.html">Amazon
* Elastic Block Store Endpoints and Quotas</a> in the <i>AWS General
* Reference</i>.</p>
*/
class AWS_EBS_API EBSClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* 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.
*/
EBSClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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.
*/
EBSClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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
*/
EBSClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~EBSClient();
/**
* <p>Seals and completes the snapshot after all of the required blocks of data
* have been written to it. Completing the snapshot changes the status to
* <code>completed</code>. You cannot write new blocks to a snapshot after it has
* been completed.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/CompleteSnapshot">AWS
* API Reference</a></p>
*/
virtual Model::CompleteSnapshotOutcome CompleteSnapshot(const Model::CompleteSnapshotRequest& request) const;
/**
* <p>Seals and completes the snapshot after all of the required blocks of data
* have been written to it. Completing the snapshot changes the status to
* <code>completed</code>. You cannot write new blocks to a snapshot after it has
* been completed.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/CompleteSnapshot">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::CompleteSnapshotOutcomeCallable CompleteSnapshotCallable(const Model::CompleteSnapshotRequest& request) const;
/**
* <p>Seals and completes the snapshot after all of the required blocks of data
* have been written to it. Completing the snapshot changes the status to
* <code>completed</code>. You cannot write new blocks to a snapshot after it has
* been completed.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/CompleteSnapshot">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void CompleteSnapshotAsync(const Model::CompleteSnapshotRequest& request, const CompleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Returns the data in a block in an Amazon Elastic Block Store
* snapshot.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/GetSnapshotBlock">AWS
* API Reference</a></p>
*/
virtual Model::GetSnapshotBlockOutcome GetSnapshotBlock(const Model::GetSnapshotBlockRequest& request) const;
/**
* <p>Returns the data in a block in an Amazon Elastic Block Store
* snapshot.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/GetSnapshotBlock">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetSnapshotBlockOutcomeCallable GetSnapshotBlockCallable(const Model::GetSnapshotBlockRequest& request) const;
/**
* <p>Returns the data in a block in an Amazon Elastic Block Store
* snapshot.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/GetSnapshotBlock">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetSnapshotBlockAsync(const Model::GetSnapshotBlockRequest& request, const GetSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Returns the block indexes and block tokens for blocks that are different
* between two Amazon Elastic Block Store snapshots of the same volume/snapshot
* lineage.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListChangedBlocks">AWS
* API Reference</a></p>
*/
virtual Model::ListChangedBlocksOutcome ListChangedBlocks(const Model::ListChangedBlocksRequest& request) const;
/**
* <p>Returns the block indexes and block tokens for blocks that are different
* between two Amazon Elastic Block Store snapshots of the same volume/snapshot
* lineage.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListChangedBlocks">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListChangedBlocksOutcomeCallable ListChangedBlocksCallable(const Model::ListChangedBlocksRequest& request) const;
/**
* <p>Returns the block indexes and block tokens for blocks that are different
* between two Amazon Elastic Block Store snapshots of the same volume/snapshot
* lineage.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListChangedBlocks">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListChangedBlocksAsync(const Model::ListChangedBlocksRequest& request, const ListChangedBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Returns the block indexes and block tokens for blocks in an Amazon Elastic
* Block Store snapshot.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListSnapshotBlocks">AWS
* API Reference</a></p>
*/
virtual Model::ListSnapshotBlocksOutcome ListSnapshotBlocks(const Model::ListSnapshotBlocksRequest& request) const;
/**
* <p>Returns the block indexes and block tokens for blocks in an Amazon Elastic
* Block Store snapshot.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListSnapshotBlocks">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListSnapshotBlocksOutcomeCallable ListSnapshotBlocksCallable(const Model::ListSnapshotBlocksRequest& request) const;
/**
* <p>Returns the block indexes and block tokens for blocks in an Amazon Elastic
* Block Store snapshot.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListSnapshotBlocks">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListSnapshotBlocksAsync(const Model::ListSnapshotBlocksRequest& request, const ListSnapshotBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Writes a block of data to a block in the snapshot. If the specified block
* contains data, the existing data is overwritten. The target snapshot must be in
* the <code>pending</code> state.</p> <p>Data written to a snapshot must be
* aligned with 512-byte sectors.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/PutSnapshotBlock">AWS
* API Reference</a></p>
*/
virtual Model::PutSnapshotBlockOutcome PutSnapshotBlock(const Model::PutSnapshotBlockRequest& request) const;
/**
* <p>Writes a block of data to a block in the snapshot. If the specified block
* contains data, the existing data is overwritten. The target snapshot must be in
* the <code>pending</code> state.</p> <p>Data written to a snapshot must be
* aligned with 512-byte sectors.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/PutSnapshotBlock">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::PutSnapshotBlockOutcomeCallable PutSnapshotBlockCallable(const Model::PutSnapshotBlockRequest& request) const;
/**
* <p>Writes a block of data to a block in the snapshot. If the specified block
* contains data, the existing data is overwritten. The target snapshot must be in
* the <code>pending</code> state.</p> <p>Data written to a snapshot must be
* aligned with 512-byte sectors.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/PutSnapshotBlock">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void PutSnapshotBlockAsync(const Model::PutSnapshotBlockRequest& request, const PutSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
/**
* <p>Creates a new Amazon EBS snapshot. The new snapshot enters the
* <code>pending</code> state after the request completes. </p> <p>After creating
* the snapshot, use <a
* href="https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html">
* PutSnapshotBlock</a> to write blocks of data to the snapshot.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/StartSnapshot">AWS
* API Reference</a></p>
*/
virtual Model::StartSnapshotOutcome StartSnapshot(const Model::StartSnapshotRequest& request) const;
/**
* <p>Creates a new Amazon EBS snapshot. The new snapshot enters the
* <code>pending</code> state after the request completes. </p> <p>After creating
* the snapshot, use <a
* href="https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html">
* PutSnapshotBlock</a> to write blocks of data to the snapshot.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/StartSnapshot">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::StartSnapshotOutcomeCallable StartSnapshotCallable(const Model::StartSnapshotRequest& request) const;
/**
* <p>Creates a new Amazon EBS snapshot. The new snapshot enters the
* <code>pending</code> state after the request completes. </p> <p>After creating
* the snapshot, use <a
* href="https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html">
* PutSnapshotBlock</a> to write blocks of data to the snapshot.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/StartSnapshot">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void StartSnapshotAsync(const Model::StartSnapshotRequest& request, const StartSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void CompleteSnapshotAsyncHelper(const Model::CompleteSnapshotRequest& request, const CompleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void GetSnapshotBlockAsyncHelper(const Model::GetSnapshotBlockRequest& request, const GetSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void ListChangedBlocksAsyncHelper(const Model::ListChangedBlocksRequest& request, const ListChangedBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void ListSnapshotBlocksAsyncHelper(const Model::ListSnapshotBlocksRequest& request, const ListSnapshotBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void PutSnapshotBlockAsyncHelper(const Model::PutSnapshotBlockRequest& request, const PutSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
void StartSnapshotAsyncHelper(const Model::StartSnapshotRequest& request, const StartSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr<Aws::Utils::Threading::Executor> m_executor;
};
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,21 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace EBSEndpoint
{
AWS_EBS_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace EBSEndpoint
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,23 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>
namespace Aws
{
namespace Client
{
class AWS_EBS_API EBSErrorMarshaller : public Aws::Client::JsonErrorMarshaller
{
public:
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
};
} // namespace Client
} // namespace Aws

View File

@@ -0,0 +1,75 @@
/**
* 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/ebs/EBS_EXPORTS.h>
namespace Aws
{
namespace EBS
{
enum class EBSErrors
{
//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,
///////////////////////////////////////////////////////////////////////////////////////////
CONCURRENT_LIMIT_EXCEEDED= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
CONFLICT,
INTERNAL_SERVER,
SERVICE_QUOTA_EXCEEDED
};
class AWS_EBS_API EBSError : public Aws::Client::AWSError<EBSErrors>
{
public:
EBSError() {}
EBSError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<EBSErrors>(rhs) {}
EBSError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<EBSErrors>(rhs) {}
EBSError(const Aws::Client::AWSError<EBSErrors>& rhs) : Aws::Client::AWSError<EBSErrors>(rhs) {}
EBSError(Aws::Client::AWSError<EBSErrors>&& rhs) : Aws::Client::AWSError<EBSErrors>(rhs) {}
template <typename T>
T GetModeledError();
};
namespace EBSErrorMapper
{
AWS_EBS_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,44 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
#include <aws/core/AmazonStreamingWebServiceRequest.h>
namespace Aws
{
namespace EBS
{
class AWS_EBS_API EBSRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~EBSRequest () {}
void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); }
inline Aws::Http::HeaderValueCollection GetHeaders() const override
{
auto headers = GetRequestSpecificHeaders();
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_1 ));
}
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::API_VERSION_HEADER, "2019-11-02"));
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
typedef Aws::AmazonStreamingWebServiceRequest StreamingEBSRequest;
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,29 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#ifdef _MSC_VER
//disable windows complaining about max template size.
#pragma warning (disable : 4503)
#endif // _MSC_VER
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#endif // _MSC_VER
#ifdef USE_IMPORT_EXPORT
#ifdef AWS_EBS_EXPORTS
#define AWS_EBS_API __declspec(dllexport)
#else
#define AWS_EBS_API __declspec(dllimport)
#endif /* AWS_EBS_EXPORTS */
#else
#define AWS_EBS_API
#endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#define AWS_EBS_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)

View File

@@ -0,0 +1,108 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/AccessDeniedExceptionReason.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>You do not have sufficient access to perform this action.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/AccessDeniedException">AWS
* API Reference</a></p>
*/
class AWS_EBS_API AccessDeniedException
{
public:
AccessDeniedException();
AccessDeniedException(Aws::Utils::Json::JsonView jsonValue);
AccessDeniedException& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
inline const Aws::String& GetMessage() const{ return m_message; }
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
inline AccessDeniedException& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
inline AccessDeniedException& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
inline AccessDeniedException& WithMessage(const char* value) { SetMessage(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline const AccessDeniedExceptionReason& GetReason() const{ return m_reason; }
/**
* <p>The reason for the exception.</p>
*/
inline bool ReasonHasBeenSet() const { return m_reasonHasBeenSet; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(const AccessDeniedExceptionReason& value) { m_reasonHasBeenSet = true; m_reason = value; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(AccessDeniedExceptionReason&& value) { m_reasonHasBeenSet = true; m_reason = std::move(value); }
/**
* <p>The reason for the exception.</p>
*/
inline AccessDeniedException& WithReason(const AccessDeniedExceptionReason& value) { SetReason(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline AccessDeniedException& WithReason(AccessDeniedExceptionReason&& value) { SetReason(std::move(value)); return *this;}
private:
Aws::String m_message;
bool m_messageHasBeenSet;
AccessDeniedExceptionReason m_reason;
bool m_reasonHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,31 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class AccessDeniedExceptionReason
{
NOT_SET,
UNAUTHORIZED_ACCOUNT,
DEPENDENCY_ACCESS_DENIED
};
namespace AccessDeniedExceptionReasonMapper
{
AWS_EBS_API AccessDeniedExceptionReason GetAccessDeniedExceptionReasonForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForAccessDeniedExceptionReason(AccessDeniedExceptionReason value);
} // namespace AccessDeniedExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,113 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>A block of data in an Amazon Elastic Block Store snapshot.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/Block">AWS API
* Reference</a></p>
*/
class AWS_EBS_API Block
{
public:
Block();
Block(Aws::Utils::Json::JsonView jsonValue);
Block& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The block index.</p>
*/
inline int GetBlockIndex() const{ return m_blockIndex; }
/**
* <p>The block index.</p>
*/
inline bool BlockIndexHasBeenSet() const { return m_blockIndexHasBeenSet; }
/**
* <p>The block index.</p>
*/
inline void SetBlockIndex(int value) { m_blockIndexHasBeenSet = true; m_blockIndex = value; }
/**
* <p>The block index.</p>
*/
inline Block& WithBlockIndex(int value) { SetBlockIndex(value); return *this;}
/**
* <p>The block token for the block index.</p>
*/
inline const Aws::String& GetBlockToken() const{ return m_blockToken; }
/**
* <p>The block token for the block index.</p>
*/
inline bool BlockTokenHasBeenSet() const { return m_blockTokenHasBeenSet; }
/**
* <p>The block token for the block index.</p>
*/
inline void SetBlockToken(const Aws::String& value) { m_blockTokenHasBeenSet = true; m_blockToken = value; }
/**
* <p>The block token for the block index.</p>
*/
inline void SetBlockToken(Aws::String&& value) { m_blockTokenHasBeenSet = true; m_blockToken = std::move(value); }
/**
* <p>The block token for the block index.</p>
*/
inline void SetBlockToken(const char* value) { m_blockTokenHasBeenSet = true; m_blockToken.assign(value); }
/**
* <p>The block token for the block index.</p>
*/
inline Block& WithBlockToken(const Aws::String& value) { SetBlockToken(value); return *this;}
/**
* <p>The block token for the block index.</p>
*/
inline Block& WithBlockToken(Aws::String&& value) { SetBlockToken(std::move(value)); return *this;}
/**
* <p>The block token for the block index.</p>
*/
inline Block& WithBlockToken(const char* value) { SetBlockToken(value); return *this;}
private:
int m_blockIndex;
bool m_blockIndexHasBeenSet;
Aws::String m_blockToken;
bool m_blockTokenHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,190 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>A block of data in an Amazon Elastic Block Store snapshot that is different
* from another snapshot of the same volume/snapshot lineage.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ChangedBlock">AWS
* API Reference</a></p>
*/
class AWS_EBS_API ChangedBlock
{
public:
ChangedBlock();
ChangedBlock(Aws::Utils::Json::JsonView jsonValue);
ChangedBlock& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The block index.</p>
*/
inline int GetBlockIndex() const{ return m_blockIndex; }
/**
* <p>The block index.</p>
*/
inline bool BlockIndexHasBeenSet() const { return m_blockIndexHasBeenSet; }
/**
* <p>The block index.</p>
*/
inline void SetBlockIndex(int value) { m_blockIndexHasBeenSet = true; m_blockIndex = value; }
/**
* <p>The block index.</p>
*/
inline ChangedBlock& WithBlockIndex(int value) { SetBlockIndex(value); return *this;}
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline const Aws::String& GetFirstBlockToken() const{ return m_firstBlockToken; }
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline bool FirstBlockTokenHasBeenSet() const { return m_firstBlockTokenHasBeenSet; }
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline void SetFirstBlockToken(const Aws::String& value) { m_firstBlockTokenHasBeenSet = true; m_firstBlockToken = value; }
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline void SetFirstBlockToken(Aws::String&& value) { m_firstBlockTokenHasBeenSet = true; m_firstBlockToken = std::move(value); }
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline void SetFirstBlockToken(const char* value) { m_firstBlockTokenHasBeenSet = true; m_firstBlockToken.assign(value); }
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline ChangedBlock& WithFirstBlockToken(const Aws::String& value) { SetFirstBlockToken(value); return *this;}
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline ChangedBlock& WithFirstBlockToken(Aws::String&& value) { SetFirstBlockToken(std::move(value)); return *this;}
/**
* <p>The block token for the block index of the <code>FirstSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation. This value is absent
* if the first snapshot does not have the changed block that is on the second
* snapshot.</p>
*/
inline ChangedBlock& WithFirstBlockToken(const char* value) { SetFirstBlockToken(value); return *this;}
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline const Aws::String& GetSecondBlockToken() const{ return m_secondBlockToken; }
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline bool SecondBlockTokenHasBeenSet() const { return m_secondBlockTokenHasBeenSet; }
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline void SetSecondBlockToken(const Aws::String& value) { m_secondBlockTokenHasBeenSet = true; m_secondBlockToken = value; }
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline void SetSecondBlockToken(Aws::String&& value) { m_secondBlockTokenHasBeenSet = true; m_secondBlockToken = std::move(value); }
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline void SetSecondBlockToken(const char* value) { m_secondBlockTokenHasBeenSet = true; m_secondBlockToken.assign(value); }
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline ChangedBlock& WithSecondBlockToken(const Aws::String& value) { SetSecondBlockToken(value); return *this;}
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline ChangedBlock& WithSecondBlockToken(Aws::String&& value) { SetSecondBlockToken(std::move(value)); return *this;}
/**
* <p>The block token for the block index of the <code>SecondSnapshotId</code>
* specified in the <code>ListChangedBlocks</code> operation.</p>
*/
inline ChangedBlock& WithSecondBlockToken(const char* value) { SetSecondBlockToken(value); return *this;}
private:
int m_blockIndex;
bool m_blockIndexHasBeenSet;
Aws::String m_firstBlockToken;
bool m_firstBlockTokenHasBeenSet;
Aws::String m_secondBlockToken;
bool m_secondBlockTokenHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,30 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class ChecksumAggregationMethod
{
NOT_SET,
LINEAR
};
namespace ChecksumAggregationMethodMapper
{
AWS_EBS_API ChecksumAggregationMethod GetChecksumAggregationMethodForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForChecksumAggregationMethod(ChecksumAggregationMethod value);
} // namespace ChecksumAggregationMethodMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,30 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class ChecksumAlgorithm
{
NOT_SET,
SHA256
};
namespace ChecksumAlgorithmMapper
{
AWS_EBS_API ChecksumAlgorithm GetChecksumAlgorithmForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForChecksumAlgorithm(ChecksumAlgorithm value);
} // namespace ChecksumAlgorithmMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,267 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/EBSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/ChecksumAlgorithm.h>
#include <aws/ebs/model/ChecksumAggregationMethod.h>
#include <utility>
namespace Aws
{
namespace EBS
{
namespace Model
{
/**
*/
class AWS_EBS_API CompleteSnapshotRequest : public EBSRequest
{
public:
CompleteSnapshotRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "CompleteSnapshot"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The ID of the snapshot.</p>
*/
inline const Aws::String& GetSnapshotId() const{ return m_snapshotId; }
/**
* <p>The ID of the snapshot.</p>
*/
inline bool SnapshotIdHasBeenSet() const { return m_snapshotIdHasBeenSet; }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(const Aws::String& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = value; }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(Aws::String&& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = std::move(value); }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(const char* value) { m_snapshotIdHasBeenSet = true; m_snapshotId.assign(value); }
/**
* <p>The ID of the snapshot.</p>
*/
inline CompleteSnapshotRequest& WithSnapshotId(const Aws::String& value) { SetSnapshotId(value); return *this;}
/**
* <p>The ID of the snapshot.</p>
*/
inline CompleteSnapshotRequest& WithSnapshotId(Aws::String&& value) { SetSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the snapshot.</p>
*/
inline CompleteSnapshotRequest& WithSnapshotId(const char* value) { SetSnapshotId(value); return *this;}
/**
* <p>The number of blocks that were written to the snapshot.</p>
*/
inline int GetChangedBlocksCount() const{ return m_changedBlocksCount; }
/**
* <p>The number of blocks that were written to the snapshot.</p>
*/
inline bool ChangedBlocksCountHasBeenSet() const { return m_changedBlocksCountHasBeenSet; }
/**
* <p>The number of blocks that were written to the snapshot.</p>
*/
inline void SetChangedBlocksCount(int value) { m_changedBlocksCountHasBeenSet = true; m_changedBlocksCount = value; }
/**
* <p>The number of blocks that were written to the snapshot.</p>
*/
inline CompleteSnapshotRequest& WithChangedBlocksCount(int value) { SetChangedBlocksCount(value); return *this;}
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline const Aws::String& GetChecksum() const{ return m_checksum; }
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline bool ChecksumHasBeenSet() const { return m_checksumHasBeenSet; }
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline void SetChecksum(const Aws::String& value) { m_checksumHasBeenSet = true; m_checksum = value; }
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline void SetChecksum(Aws::String&& value) { m_checksumHasBeenSet = true; m_checksum = std::move(value); }
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline void SetChecksum(const char* value) { m_checksumHasBeenSet = true; m_checksum.assign(value); }
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline CompleteSnapshotRequest& WithChecksum(const Aws::String& value) { SetChecksum(value); return *this;}
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline CompleteSnapshotRequest& WithChecksum(Aws::String&& value) { SetChecksum(std::move(value)); return *this;}
/**
* <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written
* block.</p> <p>To generate the aggregated checksum using the linear aggregation
* method, arrange the checksums for each written block in ascending order of their
* block index, concatenate them to form a single string, and then generate the
* checksum on the entire string using the SHA256 algorithm.</p>
*/
inline CompleteSnapshotRequest& WithChecksum(const char* value) { SetChecksum(value); return *this;}
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline const ChecksumAlgorithm& GetChecksumAlgorithm() const{ return m_checksumAlgorithm; }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline bool ChecksumAlgorithmHasBeenSet() const { return m_checksumAlgorithmHasBeenSet; }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline void SetChecksumAlgorithm(const ChecksumAlgorithm& value) { m_checksumAlgorithmHasBeenSet = true; m_checksumAlgorithm = value; }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline void SetChecksumAlgorithm(ChecksumAlgorithm&& value) { m_checksumAlgorithmHasBeenSet = true; m_checksumAlgorithm = std::move(value); }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline CompleteSnapshotRequest& WithChecksumAlgorithm(const ChecksumAlgorithm& value) { SetChecksumAlgorithm(value); return *this;}
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline CompleteSnapshotRequest& WithChecksumAlgorithm(ChecksumAlgorithm&& value) { SetChecksumAlgorithm(std::move(value)); return *this;}
/**
* <p>The aggregation method used to generate the checksum. Currently, the only
* supported aggregation method is <code>LINEAR</code>.</p>
*/
inline const ChecksumAggregationMethod& GetChecksumAggregationMethod() const{ return m_checksumAggregationMethod; }
/**
* <p>The aggregation method used to generate the checksum. Currently, the only
* supported aggregation method is <code>LINEAR</code>.</p>
*/
inline bool ChecksumAggregationMethodHasBeenSet() const { return m_checksumAggregationMethodHasBeenSet; }
/**
* <p>The aggregation method used to generate the checksum. Currently, the only
* supported aggregation method is <code>LINEAR</code>.</p>
*/
inline void SetChecksumAggregationMethod(const ChecksumAggregationMethod& value) { m_checksumAggregationMethodHasBeenSet = true; m_checksumAggregationMethod = value; }
/**
* <p>The aggregation method used to generate the checksum. Currently, the only
* supported aggregation method is <code>LINEAR</code>.</p>
*/
inline void SetChecksumAggregationMethod(ChecksumAggregationMethod&& value) { m_checksumAggregationMethodHasBeenSet = true; m_checksumAggregationMethod = std::move(value); }
/**
* <p>The aggregation method used to generate the checksum. Currently, the only
* supported aggregation method is <code>LINEAR</code>.</p>
*/
inline CompleteSnapshotRequest& WithChecksumAggregationMethod(const ChecksumAggregationMethod& value) { SetChecksumAggregationMethod(value); return *this;}
/**
* <p>The aggregation method used to generate the checksum. Currently, the only
* supported aggregation method is <code>LINEAR</code>.</p>
*/
inline CompleteSnapshotRequest& WithChecksumAggregationMethod(ChecksumAggregationMethod&& value) { SetChecksumAggregationMethod(std::move(value)); return *this;}
private:
Aws::String m_snapshotId;
bool m_snapshotIdHasBeenSet;
int m_changedBlocksCount;
bool m_changedBlocksCountHasBeenSet;
Aws::String m_checksum;
bool m_checksumHasBeenSet;
ChecksumAlgorithm m_checksumAlgorithm;
bool m_checksumAlgorithmHasBeenSet;
ChecksumAggregationMethod m_checksumAggregationMethod;
bool m_checksumAggregationMethodHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,67 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/model/Status.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
class AWS_EBS_API CompleteSnapshotResult
{
public:
CompleteSnapshotResult();
CompleteSnapshotResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
CompleteSnapshotResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The status of the snapshot.</p>
*/
inline const Status& GetStatus() const{ return m_status; }
/**
* <p>The status of the snapshot.</p>
*/
inline void SetStatus(const Status& value) { m_status = value; }
/**
* <p>The status of the snapshot.</p>
*/
inline void SetStatus(Status&& value) { m_status = std::move(value); }
/**
* <p>The status of the snapshot.</p>
*/
inline CompleteSnapshotResult& WithStatus(const Status& value) { SetStatus(value); return *this;}
/**
* <p>The status of the snapshot.</p>
*/
inline CompleteSnapshotResult& WithStatus(Status&& value) { SetStatus(std::move(value)); return *this;}
private:
Status m_status;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,181 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/EBSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Http
{
class URI;
} //namespace Http
namespace EBS
{
namespace Model
{
/**
*/
class AWS_EBS_API GetSnapshotBlockRequest : public EBSRequest
{
public:
GetSnapshotBlockRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "GetSnapshotBlock"; }
Aws::String SerializePayload() const override;
void AddQueryStringParameters(Aws::Http::URI& uri) const override;
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline const Aws::String& GetSnapshotId() const{ return m_snapshotId; }
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline bool SnapshotIdHasBeenSet() const { return m_snapshotIdHasBeenSet; }
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline void SetSnapshotId(const Aws::String& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = value; }
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline void SetSnapshotId(Aws::String&& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = std::move(value); }
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline void SetSnapshotId(const char* value) { m_snapshotIdHasBeenSet = true; m_snapshotId.assign(value); }
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline GetSnapshotBlockRequest& WithSnapshotId(const Aws::String& value) { SetSnapshotId(value); return *this;}
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline GetSnapshotBlockRequest& WithSnapshotId(Aws::String&& value) { SetSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the snapshot containing the block from which to get data.</p>
*/
inline GetSnapshotBlockRequest& WithSnapshotId(const char* value) { SetSnapshotId(value); return *this;}
/**
* <p>The block index of the block from which to get data.</p> <p>Obtain the
* <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline int GetBlockIndex() const{ return m_blockIndex; }
/**
* <p>The block index of the block from which to get data.</p> <p>Obtain the
* <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline bool BlockIndexHasBeenSet() const { return m_blockIndexHasBeenSet; }
/**
* <p>The block index of the block from which to get data.</p> <p>Obtain the
* <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline void SetBlockIndex(int value) { m_blockIndexHasBeenSet = true; m_blockIndex = value; }
/**
* <p>The block index of the block from which to get data.</p> <p>Obtain the
* <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline GetSnapshotBlockRequest& WithBlockIndex(int value) { SetBlockIndex(value); return *this;}
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline const Aws::String& GetBlockToken() const{ return m_blockToken; }
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline bool BlockTokenHasBeenSet() const { return m_blockTokenHasBeenSet; }
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline void SetBlockToken(const Aws::String& value) { m_blockTokenHasBeenSet = true; m_blockToken = value; }
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline void SetBlockToken(Aws::String&& value) { m_blockTokenHasBeenSet = true; m_blockToken = std::move(value); }
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline void SetBlockToken(const char* value) { m_blockTokenHasBeenSet = true; m_blockToken.assign(value); }
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline GetSnapshotBlockRequest& WithBlockToken(const Aws::String& value) { SetBlockToken(value); return *this;}
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline GetSnapshotBlockRequest& WithBlockToken(Aws::String&& value) { SetBlockToken(std::move(value)); return *this;}
/**
* <p>The block token of the block from which to get data.</p> <p>Obtain the
* <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
* <code>ListSnapshotBlocks</code> operations.</p>
*/
inline GetSnapshotBlockRequest& WithBlockToken(const char* value) { SetBlockToken(value); return *this;}
private:
Aws::String m_snapshotId;
bool m_snapshotIdHasBeenSet;
int m_blockIndex;
bool m_blockIndexHasBeenSet;
Aws::String m_blockToken;
bool m_blockTokenHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,147 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/stream/ResponseStream.h>
#include <aws/core/utils/Array.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/ChecksumAlgorithm.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace EBS
{
namespace Model
{
class AWS_EBS_API GetSnapshotBlockResult
{
public:
GetSnapshotBlockResult();
//We have to define these because Microsoft doesn't auto generate them
GetSnapshotBlockResult(GetSnapshotBlockResult&&);
GetSnapshotBlockResult& operator=(GetSnapshotBlockResult&&);
//we delete these because Microsoft doesn't handle move generation correctly
//and we therefore don't trust them to get it right here either.
GetSnapshotBlockResult(const GetSnapshotBlockResult&) = delete;
GetSnapshotBlockResult& operator=(const GetSnapshotBlockResult&) = delete;
GetSnapshotBlockResult(Aws::AmazonWebServiceResult<Aws::Utils::Stream::ResponseStream>&& result);
GetSnapshotBlockResult& operator=(Aws::AmazonWebServiceResult<Aws::Utils::Stream::ResponseStream>&& result);
/**
* <p>The size of the data in the block.</p>
*/
inline int GetDataLength() const{ return m_dataLength; }
/**
* <p>The size of the data in the block.</p>
*/
inline void SetDataLength(int value) { m_dataLength = value; }
/**
* <p>The size of the data in the block.</p>
*/
inline GetSnapshotBlockResult& WithDataLength(int value) { SetDataLength(value); return *this;}
/**
* <p>The data content of the block.</p>
*/
inline Aws::IOStream& GetBlockData() { return m_blockData.GetUnderlyingStream(); }
/**
* <p>The data content of the block.</p>
*/
inline void ReplaceBody(Aws::IOStream* body) { m_blockData = Aws::Utils::Stream::ResponseStream(body); }
/**
* <p>The checksum generated for the block, which is Base64 encoded.</p>
*/
inline const Aws::String& GetChecksum() const{ return m_checksum; }
/**
* <p>The checksum generated for the block, which is Base64 encoded.</p>
*/
inline void SetChecksum(const Aws::String& value) { m_checksum = value; }
/**
* <p>The checksum generated for the block, which is Base64 encoded.</p>
*/
inline void SetChecksum(Aws::String&& value) { m_checksum = std::move(value); }
/**
* <p>The checksum generated for the block, which is Base64 encoded.</p>
*/
inline void SetChecksum(const char* value) { m_checksum.assign(value); }
/**
* <p>The checksum generated for the block, which is Base64 encoded.</p>
*/
inline GetSnapshotBlockResult& WithChecksum(const Aws::String& value) { SetChecksum(value); return *this;}
/**
* <p>The checksum generated for the block, which is Base64 encoded.</p>
*/
inline GetSnapshotBlockResult& WithChecksum(Aws::String&& value) { SetChecksum(std::move(value)); return *this;}
/**
* <p>The checksum generated for the block, which is Base64 encoded.</p>
*/
inline GetSnapshotBlockResult& WithChecksum(const char* value) { SetChecksum(value); return *this;}
/**
* <p>The algorithm used to generate the checksum for the block, such as
* SHA256.</p>
*/
inline const ChecksumAlgorithm& GetChecksumAlgorithm() const{ return m_checksumAlgorithm; }
/**
* <p>The algorithm used to generate the checksum for the block, such as
* SHA256.</p>
*/
inline void SetChecksumAlgorithm(const ChecksumAlgorithm& value) { m_checksumAlgorithm = value; }
/**
* <p>The algorithm used to generate the checksum for the block, such as
* SHA256.</p>
*/
inline void SetChecksumAlgorithm(ChecksumAlgorithm&& value) { m_checksumAlgorithm = std::move(value); }
/**
* <p>The algorithm used to generate the checksum for the block, such as
* SHA256.</p>
*/
inline GetSnapshotBlockResult& WithChecksumAlgorithm(const ChecksumAlgorithm& value) { SetChecksumAlgorithm(value); return *this;}
/**
* <p>The algorithm used to generate the checksum for the block, such as
* SHA256.</p>
*/
inline GetSnapshotBlockResult& WithChecksumAlgorithm(ChecksumAlgorithm&& value) { SetChecksumAlgorithm(std::move(value)); return *this;}
private:
int m_dataLength;
Aws::Utils::Stream::ResponseStream m_blockData;
Aws::String m_checksum;
ChecksumAlgorithm m_checksumAlgorithm;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,281 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/EBSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Http
{
class URI;
} //namespace Http
namespace EBS
{
namespace Model
{
/**
*/
class AWS_EBS_API ListChangedBlocksRequest : public EBSRequest
{
public:
ListChangedBlocksRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "ListChangedBlocks"; }
Aws::String SerializePayload() const override;
void AddQueryStringParameters(Aws::Http::URI& uri) const override;
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline const Aws::String& GetFirstSnapshotId() const{ return m_firstSnapshotId; }
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline bool FirstSnapshotIdHasBeenSet() const { return m_firstSnapshotIdHasBeenSet; }
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline void SetFirstSnapshotId(const Aws::String& value) { m_firstSnapshotIdHasBeenSet = true; m_firstSnapshotId = value; }
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline void SetFirstSnapshotId(Aws::String&& value) { m_firstSnapshotIdHasBeenSet = true; m_firstSnapshotId = std::move(value); }
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline void SetFirstSnapshotId(const char* value) { m_firstSnapshotIdHasBeenSet = true; m_firstSnapshotId.assign(value); }
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline ListChangedBlocksRequest& WithFirstSnapshotId(const Aws::String& value) { SetFirstSnapshotId(value); return *this;}
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline ListChangedBlocksRequest& WithFirstSnapshotId(Aws::String&& value) { SetFirstSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the first snapshot to use for the comparison.</p>
* <p>The <code>FirstSnapshotID</code> parameter must be specified with a
* <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
*
*/
inline ListChangedBlocksRequest& WithFirstSnapshotId(const char* value) { SetFirstSnapshotId(value); return *this;}
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline const Aws::String& GetSecondSnapshotId() const{ return m_secondSnapshotId; }
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline bool SecondSnapshotIdHasBeenSet() const { return m_secondSnapshotIdHasBeenSet; }
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline void SetSecondSnapshotId(const Aws::String& value) { m_secondSnapshotIdHasBeenSet = true; m_secondSnapshotId = value; }
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline void SetSecondSnapshotId(Aws::String&& value) { m_secondSnapshotIdHasBeenSet = true; m_secondSnapshotId = std::move(value); }
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline void SetSecondSnapshotId(const char* value) { m_secondSnapshotIdHasBeenSet = true; m_secondSnapshotId.assign(value); }
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline ListChangedBlocksRequest& WithSecondSnapshotId(const Aws::String& value) { SetSecondSnapshotId(value); return *this;}
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline ListChangedBlocksRequest& WithSecondSnapshotId(Aws::String&& value) { SetSecondSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the second snapshot to use for the comparison.</p>
* <p>The <code>SecondSnapshotId</code> parameter must be specified with a
* <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
*
*/
inline ListChangedBlocksRequest& WithSecondSnapshotId(const char* value) { SetSecondSnapshotId(value); return *this;}
/**
* <p>The token to request the next page of results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The token to request the next page of results.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>The token to request the next page of results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>The token to request the next page of results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>The token to request the next page of results.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>The token to request the next page of results.</p>
*/
inline ListChangedBlocksRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The token to request the next page of results.</p>
*/
inline ListChangedBlocksRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The token to request the next page of results.</p>
*/
inline ListChangedBlocksRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
/**
* <p>The number of results to return.</p>
*/
inline int GetMaxResults() const{ return m_maxResults; }
/**
* <p>The number of results to return.</p>
*/
inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }
/**
* <p>The number of results to return.</p>
*/
inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }
/**
* <p>The number of results to return.</p>
*/
inline ListChangedBlocksRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}
/**
* <p>The block index from which the comparison should start.</p> <p>The list in
* the response will start from this block index or the next valid block index in
* the snapshots.</p>
*/
inline int GetStartingBlockIndex() const{ return m_startingBlockIndex; }
/**
* <p>The block index from which the comparison should start.</p> <p>The list in
* the response will start from this block index or the next valid block index in
* the snapshots.</p>
*/
inline bool StartingBlockIndexHasBeenSet() const { return m_startingBlockIndexHasBeenSet; }
/**
* <p>The block index from which the comparison should start.</p> <p>The list in
* the response will start from this block index or the next valid block index in
* the snapshots.</p>
*/
inline void SetStartingBlockIndex(int value) { m_startingBlockIndexHasBeenSet = true; m_startingBlockIndex = value; }
/**
* <p>The block index from which the comparison should start.</p> <p>The list in
* the response will start from this block index or the next valid block index in
* the snapshots.</p>
*/
inline ListChangedBlocksRequest& WithStartingBlockIndex(int value) { SetStartingBlockIndex(value); return *this;}
private:
Aws::String m_firstSnapshotId;
bool m_firstSnapshotIdHasBeenSet;
Aws::String m_secondSnapshotId;
bool m_secondSnapshotIdHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
int m_maxResults;
bool m_maxResultsHasBeenSet;
int m_startingBlockIndex;
bool m_startingBlockIndexHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,189 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/ChangedBlock.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
class AWS_EBS_API ListChangedBlocksResult
{
public:
ListChangedBlocksResult();
ListChangedBlocksResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ListChangedBlocksResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>An array of objects containing information about the changed blocks.</p>
*/
inline const Aws::Vector<ChangedBlock>& GetChangedBlocks() const{ return m_changedBlocks; }
/**
* <p>An array of objects containing information about the changed blocks.</p>
*/
inline void SetChangedBlocks(const Aws::Vector<ChangedBlock>& value) { m_changedBlocks = value; }
/**
* <p>An array of objects containing information about the changed blocks.</p>
*/
inline void SetChangedBlocks(Aws::Vector<ChangedBlock>&& value) { m_changedBlocks = std::move(value); }
/**
* <p>An array of objects containing information about the changed blocks.</p>
*/
inline ListChangedBlocksResult& WithChangedBlocks(const Aws::Vector<ChangedBlock>& value) { SetChangedBlocks(value); return *this;}
/**
* <p>An array of objects containing information about the changed blocks.</p>
*/
inline ListChangedBlocksResult& WithChangedBlocks(Aws::Vector<ChangedBlock>&& value) { SetChangedBlocks(std::move(value)); return *this;}
/**
* <p>An array of objects containing information about the changed blocks.</p>
*/
inline ListChangedBlocksResult& AddChangedBlocks(const ChangedBlock& value) { m_changedBlocks.push_back(value); return *this; }
/**
* <p>An array of objects containing information about the changed blocks.</p>
*/
inline ListChangedBlocksResult& AddChangedBlocks(ChangedBlock&& value) { m_changedBlocks.push_back(std::move(value)); return *this; }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline const Aws::Utils::DateTime& GetExpiryTime() const{ return m_expiryTime; }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline void SetExpiryTime(const Aws::Utils::DateTime& value) { m_expiryTime = value; }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline void SetExpiryTime(Aws::Utils::DateTime&& value) { m_expiryTime = std::move(value); }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline ListChangedBlocksResult& WithExpiryTime(const Aws::Utils::DateTime& value) { SetExpiryTime(value); return *this;}
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline ListChangedBlocksResult& WithExpiryTime(Aws::Utils::DateTime&& value) { SetExpiryTime(std::move(value)); return *this;}
/**
* <p>The size of the volume in GB.</p>
*/
inline long long GetVolumeSize() const{ return m_volumeSize; }
/**
* <p>The size of the volume in GB.</p>
*/
inline void SetVolumeSize(long long value) { m_volumeSize = value; }
/**
* <p>The size of the volume in GB.</p>
*/
inline ListChangedBlocksResult& WithVolumeSize(long long value) { SetVolumeSize(value); return *this;}
/**
* <p>The size of the block.</p>
*/
inline int GetBlockSize() const{ return m_blockSize; }
/**
* <p>The size of the block.</p>
*/
inline void SetBlockSize(int value) { m_blockSize = value; }
/**
* <p>The size of the block.</p>
*/
inline ListChangedBlocksResult& WithBlockSize(int value) { SetBlockSize(value); return *this;}
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline ListChangedBlocksResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline ListChangedBlocksResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline ListChangedBlocksResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<ChangedBlock> m_changedBlocks;
Aws::Utils::DateTime m_expiryTime;
long long m_volumeSize;
int m_blockSize;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,189 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/EBSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Http
{
class URI;
} //namespace Http
namespace EBS
{
namespace Model
{
/**
*/
class AWS_EBS_API ListSnapshotBlocksRequest : public EBSRequest
{
public:
ListSnapshotBlocksRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "ListSnapshotBlocks"; }
Aws::String SerializePayload() const override;
void AddQueryStringParameters(Aws::Http::URI& uri) const override;
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline const Aws::String& GetSnapshotId() const{ return m_snapshotId; }
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline bool SnapshotIdHasBeenSet() const { return m_snapshotIdHasBeenSet; }
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline void SetSnapshotId(const Aws::String& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = value; }
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline void SetSnapshotId(Aws::String&& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = std::move(value); }
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline void SetSnapshotId(const char* value) { m_snapshotIdHasBeenSet = true; m_snapshotId.assign(value); }
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline ListSnapshotBlocksRequest& WithSnapshotId(const Aws::String& value) { SetSnapshotId(value); return *this;}
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline ListSnapshotBlocksRequest& WithSnapshotId(Aws::String&& value) { SetSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
*/
inline ListSnapshotBlocksRequest& WithSnapshotId(const char* value) { SetSnapshotId(value); return *this;}
/**
* <p>The token to request the next page of results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The token to request the next page of results.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>The token to request the next page of results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>The token to request the next page of results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>The token to request the next page of results.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>The token to request the next page of results.</p>
*/
inline ListSnapshotBlocksRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The token to request the next page of results.</p>
*/
inline ListSnapshotBlocksRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The token to request the next page of results.</p>
*/
inline ListSnapshotBlocksRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
/**
* <p>The number of results to return.</p>
*/
inline int GetMaxResults() const{ return m_maxResults; }
/**
* <p>The number of results to return.</p>
*/
inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }
/**
* <p>The number of results to return.</p>
*/
inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }
/**
* <p>The number of results to return.</p>
*/
inline ListSnapshotBlocksRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}
/**
* <p>The block index from which the list should start. The list in the response
* will start from this block index or the next valid block index in the
* snapshot.</p>
*/
inline int GetStartingBlockIndex() const{ return m_startingBlockIndex; }
/**
* <p>The block index from which the list should start. The list in the response
* will start from this block index or the next valid block index in the
* snapshot.</p>
*/
inline bool StartingBlockIndexHasBeenSet() const { return m_startingBlockIndexHasBeenSet; }
/**
* <p>The block index from which the list should start. The list in the response
* will start from this block index or the next valid block index in the
* snapshot.</p>
*/
inline void SetStartingBlockIndex(int value) { m_startingBlockIndexHasBeenSet = true; m_startingBlockIndex = value; }
/**
* <p>The block index from which the list should start. The list in the response
* will start from this block index or the next valid block index in the
* snapshot.</p>
*/
inline ListSnapshotBlocksRequest& WithStartingBlockIndex(int value) { SetStartingBlockIndex(value); return *this;}
private:
Aws::String m_snapshotId;
bool m_snapshotIdHasBeenSet;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet;
int m_maxResults;
bool m_maxResultsHasBeenSet;
int m_startingBlockIndex;
bool m_startingBlockIndexHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,189 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/Block.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
class AWS_EBS_API ListSnapshotBlocksResult
{
public:
ListSnapshotBlocksResult();
ListSnapshotBlocksResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ListSnapshotBlocksResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>An array of objects containing information about the blocks.</p>
*/
inline const Aws::Vector<Block>& GetBlocks() const{ return m_blocks; }
/**
* <p>An array of objects containing information about the blocks.</p>
*/
inline void SetBlocks(const Aws::Vector<Block>& value) { m_blocks = value; }
/**
* <p>An array of objects containing information about the blocks.</p>
*/
inline void SetBlocks(Aws::Vector<Block>&& value) { m_blocks = std::move(value); }
/**
* <p>An array of objects containing information about the blocks.</p>
*/
inline ListSnapshotBlocksResult& WithBlocks(const Aws::Vector<Block>& value) { SetBlocks(value); return *this;}
/**
* <p>An array of objects containing information about the blocks.</p>
*/
inline ListSnapshotBlocksResult& WithBlocks(Aws::Vector<Block>&& value) { SetBlocks(std::move(value)); return *this;}
/**
* <p>An array of objects containing information about the blocks.</p>
*/
inline ListSnapshotBlocksResult& AddBlocks(const Block& value) { m_blocks.push_back(value); return *this; }
/**
* <p>An array of objects containing information about the blocks.</p>
*/
inline ListSnapshotBlocksResult& AddBlocks(Block&& value) { m_blocks.push_back(std::move(value)); return *this; }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline const Aws::Utils::DateTime& GetExpiryTime() const{ return m_expiryTime; }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline void SetExpiryTime(const Aws::Utils::DateTime& value) { m_expiryTime = value; }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline void SetExpiryTime(Aws::Utils::DateTime&& value) { m_expiryTime = std::move(value); }
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline ListSnapshotBlocksResult& WithExpiryTime(const Aws::Utils::DateTime& value) { SetExpiryTime(value); return *this;}
/**
* <p>The time when the <code>BlockToken</code> expires.</p>
*/
inline ListSnapshotBlocksResult& WithExpiryTime(Aws::Utils::DateTime&& value) { SetExpiryTime(std::move(value)); return *this;}
/**
* <p>The size of the volume in GB.</p>
*/
inline long long GetVolumeSize() const{ return m_volumeSize; }
/**
* <p>The size of the volume in GB.</p>
*/
inline void SetVolumeSize(long long value) { m_volumeSize = value; }
/**
* <p>The size of the volume in GB.</p>
*/
inline ListSnapshotBlocksResult& WithVolumeSize(long long value) { SetVolumeSize(value); return *this;}
/**
* <p>The size of the block.</p>
*/
inline int GetBlockSize() const{ return m_blockSize; }
/**
* <p>The size of the block.</p>
*/
inline void SetBlockSize(int value) { m_blockSize = value; }
/**
* <p>The size of the block.</p>
*/
inline ListSnapshotBlocksResult& WithBlockSize(int value) { SetBlockSize(value); return *this;}
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline ListSnapshotBlocksResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline ListSnapshotBlocksResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The token to use to retrieve the next page of results. This value is null
* when there are no more results to return.</p>
*/
inline ListSnapshotBlocksResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
private:
Aws::Vector<Block> m_blocks;
Aws::Utils::DateTime m_expiryTime;
long long m_volumeSize;
int m_blockSize;
Aws::String m_nextToken;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,272 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/EBSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/Array.h>
#include <aws/ebs/model/ChecksumAlgorithm.h>
#include <utility>
namespace Aws
{
namespace EBS
{
namespace Model
{
/**
*/
class AWS_EBS_API PutSnapshotBlockRequest : public StreamingEBSRequest
{
public:
PutSnapshotBlockRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "PutSnapshotBlock"; }
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
bool SignBody() const override { return false; }
/**
* <p>The ID of the snapshot.</p>
*/
inline const Aws::String& GetSnapshotId() const{ return m_snapshotId; }
/**
* <p>The ID of the snapshot.</p>
*/
inline bool SnapshotIdHasBeenSet() const { return m_snapshotIdHasBeenSet; }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(const Aws::String& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = value; }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(Aws::String&& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = std::move(value); }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(const char* value) { m_snapshotIdHasBeenSet = true; m_snapshotId.assign(value); }
/**
* <p>The ID of the snapshot.</p>
*/
inline PutSnapshotBlockRequest& WithSnapshotId(const Aws::String& value) { SetSnapshotId(value); return *this;}
/**
* <p>The ID of the snapshot.</p>
*/
inline PutSnapshotBlockRequest& WithSnapshotId(Aws::String&& value) { SetSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the snapshot.</p>
*/
inline PutSnapshotBlockRequest& WithSnapshotId(const char* value) { SetSnapshotId(value); return *this;}
/**
* <p>The block index of the block in which to write the data. A block index is the
* offset position of a block within a snapshot, and it is used to identify the
* block. To identify the logical offset of the data in the logical volume,
* multiply the block index with the block size (Block index * 512 bytes).</p>
*/
inline int GetBlockIndex() const{ return m_blockIndex; }
/**
* <p>The block index of the block in which to write the data. A block index is the
* offset position of a block within a snapshot, and it is used to identify the
* block. To identify the logical offset of the data in the logical volume,
* multiply the block index with the block size (Block index * 512 bytes).</p>
*/
inline bool BlockIndexHasBeenSet() const { return m_blockIndexHasBeenSet; }
/**
* <p>The block index of the block in which to write the data. A block index is the
* offset position of a block within a snapshot, and it is used to identify the
* block. To identify the logical offset of the data in the logical volume,
* multiply the block index with the block size (Block index * 512 bytes).</p>
*/
inline void SetBlockIndex(int value) { m_blockIndexHasBeenSet = true; m_blockIndex = value; }
/**
* <p>The block index of the block in which to write the data. A block index is the
* offset position of a block within a snapshot, and it is used to identify the
* block. To identify the logical offset of the data in the logical volume,
* multiply the block index with the block size (Block index * 512 bytes).</p>
*/
inline PutSnapshotBlockRequest& WithBlockIndex(int value) { SetBlockIndex(value); return *this;}
/**
* <p>The size of the data to write to the block, in bytes. Currently, the only
* supported size is <code>524288</code>.</p> <p>Valid values: <code>524288</code>
* </p>
*/
inline int GetDataLength() const{ return m_dataLength; }
/**
* <p>The size of the data to write to the block, in bytes. Currently, the only
* supported size is <code>524288</code>.</p> <p>Valid values: <code>524288</code>
* </p>
*/
inline bool DataLengthHasBeenSet() const { return m_dataLengthHasBeenSet; }
/**
* <p>The size of the data to write to the block, in bytes. Currently, the only
* supported size is <code>524288</code>.</p> <p>Valid values: <code>524288</code>
* </p>
*/
inline void SetDataLength(int value) { m_dataLengthHasBeenSet = true; m_dataLength = value; }
/**
* <p>The size of the data to write to the block, in bytes. Currently, the only
* supported size is <code>524288</code>.</p> <p>Valid values: <code>524288</code>
* </p>
*/
inline PutSnapshotBlockRequest& WithDataLength(int value) { SetDataLength(value); return *this;}
/**
* <p>The progress of the write process, as a percentage.</p>
*/
inline int GetProgress() const{ return m_progress; }
/**
* <p>The progress of the write process, as a percentage.</p>
*/
inline bool ProgressHasBeenSet() const { return m_progressHasBeenSet; }
/**
* <p>The progress of the write process, as a percentage.</p>
*/
inline void SetProgress(int value) { m_progressHasBeenSet = true; m_progress = value; }
/**
* <p>The progress of the write process, as a percentage.</p>
*/
inline PutSnapshotBlockRequest& WithProgress(int value) { SetProgress(value); return *this;}
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline const Aws::String& GetChecksum() const{ return m_checksum; }
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline bool ChecksumHasBeenSet() const { return m_checksumHasBeenSet; }
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline void SetChecksum(const Aws::String& value) { m_checksumHasBeenSet = true; m_checksum = value; }
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline void SetChecksum(Aws::String&& value) { m_checksumHasBeenSet = true; m_checksum = std::move(value); }
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline void SetChecksum(const char* value) { m_checksumHasBeenSet = true; m_checksum.assign(value); }
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline PutSnapshotBlockRequest& WithChecksum(const Aws::String& value) { SetChecksum(value); return *this;}
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline PutSnapshotBlockRequest& WithChecksum(Aws::String&& value) { SetChecksum(std::move(value)); return *this;}
/**
* <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
* supported.</p>
*/
inline PutSnapshotBlockRequest& WithChecksum(const char* value) { SetChecksum(value); return *this;}
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline const ChecksumAlgorithm& GetChecksumAlgorithm() const{ return m_checksumAlgorithm; }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline bool ChecksumAlgorithmHasBeenSet() const { return m_checksumAlgorithmHasBeenSet; }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline void SetChecksumAlgorithm(const ChecksumAlgorithm& value) { m_checksumAlgorithmHasBeenSet = true; m_checksumAlgorithm = value; }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline void SetChecksumAlgorithm(ChecksumAlgorithm&& value) { m_checksumAlgorithmHasBeenSet = true; m_checksumAlgorithm = std::move(value); }
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline PutSnapshotBlockRequest& WithChecksumAlgorithm(const ChecksumAlgorithm& value) { SetChecksumAlgorithm(value); return *this;}
/**
* <p>The algorithm used to generate the checksum. Currently, the only supported
* algorithm is <code>SHA256</code>.</p>
*/
inline PutSnapshotBlockRequest& WithChecksumAlgorithm(ChecksumAlgorithm&& value) { SetChecksumAlgorithm(std::move(value)); return *this;}
private:
Aws::String m_snapshotId;
bool m_snapshotIdHasBeenSet;
int m_blockIndex;
bool m_blockIndexHasBeenSet;
int m_dataLength;
bool m_dataLengthHasBeenSet;
int m_progress;
bool m_progressHasBeenSet;
Aws::String m_checksum;
bool m_checksumHasBeenSet;
ChecksumAlgorithm m_checksumAlgorithm;
bool m_checksumAlgorithmHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,106 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/ChecksumAlgorithm.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
class AWS_EBS_API PutSnapshotBlockResult
{
public:
PutSnapshotBlockResult();
PutSnapshotBlockResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
PutSnapshotBlockResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
*/
inline const Aws::String& GetChecksum() const{ return m_checksum; }
/**
* <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
*/
inline void SetChecksum(const Aws::String& value) { m_checksum = value; }
/**
* <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
*/
inline void SetChecksum(Aws::String&& value) { m_checksum = std::move(value); }
/**
* <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
*/
inline void SetChecksum(const char* value) { m_checksum.assign(value); }
/**
* <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
*/
inline PutSnapshotBlockResult& WithChecksum(const Aws::String& value) { SetChecksum(value); return *this;}
/**
* <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
*/
inline PutSnapshotBlockResult& WithChecksum(Aws::String&& value) { SetChecksum(std::move(value)); return *this;}
/**
* <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
*/
inline PutSnapshotBlockResult& WithChecksum(const char* value) { SetChecksum(value); return *this;}
/**
* <p>The algorithm used by Amazon EBS to generate the checksum.</p>
*/
inline const ChecksumAlgorithm& GetChecksumAlgorithm() const{ return m_checksumAlgorithm; }
/**
* <p>The algorithm used by Amazon EBS to generate the checksum.</p>
*/
inline void SetChecksumAlgorithm(const ChecksumAlgorithm& value) { m_checksumAlgorithm = value; }
/**
* <p>The algorithm used by Amazon EBS to generate the checksum.</p>
*/
inline void SetChecksumAlgorithm(ChecksumAlgorithm&& value) { m_checksumAlgorithm = std::move(value); }
/**
* <p>The algorithm used by Amazon EBS to generate the checksum.</p>
*/
inline PutSnapshotBlockResult& WithChecksumAlgorithm(const ChecksumAlgorithm& value) { SetChecksumAlgorithm(value); return *this;}
/**
* <p>The algorithm used by Amazon EBS to generate the checksum.</p>
*/
inline PutSnapshotBlockResult& WithChecksumAlgorithm(ChecksumAlgorithm&& value) { SetChecksumAlgorithm(std::move(value)); return *this;}
private:
Aws::String m_checksum;
ChecksumAlgorithm m_checksumAlgorithm;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,108 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/RequestThrottledExceptionReason.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>The number of API requests has exceed the maximum allowed API request
* throttling limit.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/RequestThrottledException">AWS
* API Reference</a></p>
*/
class AWS_EBS_API RequestThrottledException
{
public:
RequestThrottledException();
RequestThrottledException(Aws::Utils::Json::JsonView jsonValue);
RequestThrottledException& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
inline const Aws::String& GetMessage() const{ return m_message; }
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
inline RequestThrottledException& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
inline RequestThrottledException& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
inline RequestThrottledException& WithMessage(const char* value) { SetMessage(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline const RequestThrottledExceptionReason& GetReason() const{ return m_reason; }
/**
* <p>The reason for the exception.</p>
*/
inline bool ReasonHasBeenSet() const { return m_reasonHasBeenSet; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(const RequestThrottledExceptionReason& value) { m_reasonHasBeenSet = true; m_reason = value; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(RequestThrottledExceptionReason&& value) { m_reasonHasBeenSet = true; m_reason = std::move(value); }
/**
* <p>The reason for the exception.</p>
*/
inline RequestThrottledException& WithReason(const RequestThrottledExceptionReason& value) { SetReason(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline RequestThrottledException& WithReason(RequestThrottledExceptionReason&& value) { SetReason(std::move(value)); return *this;}
private:
Aws::String m_message;
bool m_messageHasBeenSet;
RequestThrottledExceptionReason m_reason;
bool m_reasonHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,31 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class RequestThrottledExceptionReason
{
NOT_SET,
ACCOUNT_THROTTLED,
DEPENDENCY_REQUEST_THROTTLED
};
namespace RequestThrottledExceptionReasonMapper
{
AWS_EBS_API RequestThrottledExceptionReason GetRequestThrottledExceptionReasonForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForRequestThrottledExceptionReason(RequestThrottledExceptionReason value);
} // namespace RequestThrottledExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,107 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/ResourceNotFoundExceptionReason.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>The specified resource does not exist.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ResourceNotFoundException">AWS
* API Reference</a></p>
*/
class AWS_EBS_API ResourceNotFoundException
{
public:
ResourceNotFoundException();
ResourceNotFoundException(Aws::Utils::Json::JsonView jsonValue);
ResourceNotFoundException& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
inline const Aws::String& GetMessage() const{ return m_message; }
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
inline ResourceNotFoundException& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
inline ResourceNotFoundException& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
inline ResourceNotFoundException& WithMessage(const char* value) { SetMessage(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline const ResourceNotFoundExceptionReason& GetReason() const{ return m_reason; }
/**
* <p>The reason for the exception.</p>
*/
inline bool ReasonHasBeenSet() const { return m_reasonHasBeenSet; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(const ResourceNotFoundExceptionReason& value) { m_reasonHasBeenSet = true; m_reason = value; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(ResourceNotFoundExceptionReason&& value) { m_reasonHasBeenSet = true; m_reason = std::move(value); }
/**
* <p>The reason for the exception.</p>
*/
inline ResourceNotFoundException& WithReason(const ResourceNotFoundExceptionReason& value) { SetReason(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline ResourceNotFoundException& WithReason(ResourceNotFoundExceptionReason&& value) { SetReason(std::move(value)); return *this;}
private:
Aws::String m_message;
bool m_messageHasBeenSet;
ResourceNotFoundExceptionReason m_reason;
bool m_reasonHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,31 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class ResourceNotFoundExceptionReason
{
NOT_SET,
SNAPSHOT_NOT_FOUND,
DEPENDENCY_RESOURCE_NOT_FOUND
};
namespace ResourceNotFoundExceptionReasonMapper
{
AWS_EBS_API ResourceNotFoundExceptionReason GetResourceNotFoundExceptionReasonForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForResourceNotFoundExceptionReason(ResourceNotFoundExceptionReason value);
} // namespace ResourceNotFoundExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,108 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/ServiceQuotaExceededExceptionReason.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>Your current service quotas do not allow you to perform this
* action.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ServiceQuotaExceededException">AWS
* API Reference</a></p>
*/
class AWS_EBS_API ServiceQuotaExceededException
{
public:
ServiceQuotaExceededException();
ServiceQuotaExceededException(Aws::Utils::Json::JsonView jsonValue);
ServiceQuotaExceededException& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
inline const Aws::String& GetMessage() const{ return m_message; }
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
inline ServiceQuotaExceededException& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
inline ServiceQuotaExceededException& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
inline ServiceQuotaExceededException& WithMessage(const char* value) { SetMessage(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline const ServiceQuotaExceededExceptionReason& GetReason() const{ return m_reason; }
/**
* <p>The reason for the exception.</p>
*/
inline bool ReasonHasBeenSet() const { return m_reasonHasBeenSet; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(const ServiceQuotaExceededExceptionReason& value) { m_reasonHasBeenSet = true; m_reason = value; }
/**
* <p>The reason for the exception.</p>
*/
inline void SetReason(ServiceQuotaExceededExceptionReason&& value) { m_reasonHasBeenSet = true; m_reason = std::move(value); }
/**
* <p>The reason for the exception.</p>
*/
inline ServiceQuotaExceededException& WithReason(const ServiceQuotaExceededExceptionReason& value) { SetReason(value); return *this;}
/**
* <p>The reason for the exception.</p>
*/
inline ServiceQuotaExceededException& WithReason(ServiceQuotaExceededExceptionReason&& value) { SetReason(std::move(value)); return *this;}
private:
Aws::String m_message;
bool m_messageHasBeenSet;
ServiceQuotaExceededExceptionReason m_reason;
bool m_reasonHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,30 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class ServiceQuotaExceededExceptionReason
{
NOT_SET,
DEPENDENCY_SERVICE_QUOTA_EXCEEDED
};
namespace ServiceQuotaExceededExceptionReasonMapper
{
AWS_EBS_API ServiceQuotaExceededExceptionReason GetServiceQuotaExceededExceptionReasonForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForServiceQuotaExceededExceptionReason(ServiceQuotaExceededExceptionReason value);
} // namespace ServiceQuotaExceededExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,558 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/ebs/EBSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/ebs/model/Tag.h>
#include <utility>
#include <aws/core/utils/UUID.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
/**
*/
class AWS_EBS_API StartSnapshotRequest : public EBSRequest
{
public:
StartSnapshotRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "StartSnapshot"; }
Aws::String SerializePayload() const override;
/**
* <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB
* (16 TiB).</p>
*/
inline long long GetVolumeSize() const{ return m_volumeSize; }
/**
* <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB
* (16 TiB).</p>
*/
inline bool VolumeSizeHasBeenSet() const { return m_volumeSizeHasBeenSet; }
/**
* <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB
* (16 TiB).</p>
*/
inline void SetVolumeSize(long long value) { m_volumeSizeHasBeenSet = true; m_volumeSize = value; }
/**
* <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB
* (16 TiB).</p>
*/
inline StartSnapshotRequest& WithVolumeSize(long long value) { SetVolumeSize(value); return *this;}
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline const Aws::String& GetParentSnapshotId() const{ return m_parentSnapshotId; }
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline bool ParentSnapshotIdHasBeenSet() const { return m_parentSnapshotIdHasBeenSet; }
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline void SetParentSnapshotId(const Aws::String& value) { m_parentSnapshotIdHasBeenSet = true; m_parentSnapshotId = value; }
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline void SetParentSnapshotId(Aws::String&& value) { m_parentSnapshotIdHasBeenSet = true; m_parentSnapshotId = std::move(value); }
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline void SetParentSnapshotId(const char* value) { m_parentSnapshotIdHasBeenSet = true; m_parentSnapshotId.assign(value); }
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline StartSnapshotRequest& WithParentSnapshotId(const Aws::String& value) { SetParentSnapshotId(value); return *this;}
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline StartSnapshotRequest& WithParentSnapshotId(Aws::String&& value) { SetParentSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are
* creating the first snapshot for an on-premises volume, omit this parameter.</p>
* <p>If your account is enabled for encryption by default, you cannot use an
* unencrypted snapshot as a parent snapshot. You must first create an encrypted
* copy of the parent snapshot using <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
*/
inline StartSnapshotRequest& WithParentSnapshotId(const char* value) { SetParentSnapshotId(value); return *this;}
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline StartSnapshotRequest& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline StartSnapshotRequest& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline StartSnapshotRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
/**
* <p>The tags to apply to the snapshot.</p>
*/
inline StartSnapshotRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }
/**
* <p>A description for the snapshot.</p>
*/
inline const Aws::String& GetDescription() const{ return m_description; }
/**
* <p>A description for the snapshot.</p>
*/
inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }
/**
* <p>A description for the snapshot.</p>
*/
inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }
/**
* <p>A description for the snapshot.</p>
*/
inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }
/**
* <p>A description for the snapshot.</p>
*/
inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }
/**
* <p>A description for the snapshot.</p>
*/
inline StartSnapshotRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}
/**
* <p>A description for the snapshot.</p>
*/
inline StartSnapshotRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}
/**
* <p>A description for the snapshot.</p>
*/
inline StartSnapshotRequest& WithDescription(const char* value) { SetDescription(value); return *this;}
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline const Aws::String& GetClientToken() const{ return m_clientToken; }
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; }
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline void SetClientToken(const Aws::String& value) { m_clientTokenHasBeenSet = true; m_clientToken = value; }
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline void SetClientToken(Aws::String&& value) { m_clientTokenHasBeenSet = true; m_clientToken = std::move(value); }
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline void SetClientToken(const char* value) { m_clientTokenHasBeenSet = true; m_clientToken.assign(value); }
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline StartSnapshotRequest& WithClientToken(const Aws::String& value) { SetClientToken(value); return *this;}
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline StartSnapshotRequest& WithClientToken(Aws::String&& value) { SetClientToken(std::move(value)); return *this;}
/**
* <p>A unique, case-sensitive identifier that you provide to ensure the
* idempotency of the request. Idempotency ensures that an API request completes
* only once. With an idempotent request, if the original request completes
* successfully. The subsequent retries with the same client token return the
* result from the original successful request and they have no additional
* effect.</p> <p>If you do not specify a client token, one is automatically
* generated by the AWS SDK.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html">
* Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline StartSnapshotRequest& WithClientToken(const char* value) { SetClientToken(value); return *this;}
/**
* <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot,
* specify <code>true</code>. To create an unencrypted snapshot, omit this
* parameter.</p> <p>If you specify a value for <b>ParentSnapshotId</b>, omit this
* parameter.</p> <p>If you specify <code>true</code>, the snapshot is encrypted
* using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is
* specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no
* default CMK has been specified for your account, the AWS managed CMK is used. To
* set a default CMK for your account, use <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html">
* ModifyEbsDefaultKmsKeyId</a>.</p> <p>If your account is enabled for encryption
* by default, you cannot set this parameter to <code>false</code>. In this case,
* you can omit this parameter.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption">
* Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
*/
inline bool GetEncrypted() const{ return m_encrypted; }
/**
* <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot,
* specify <code>true</code>. To create an unencrypted snapshot, omit this
* parameter.</p> <p>If you specify a value for <b>ParentSnapshotId</b>, omit this
* parameter.</p> <p>If you specify <code>true</code>, the snapshot is encrypted
* using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is
* specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no
* default CMK has been specified for your account, the AWS managed CMK is used. To
* set a default CMK for your account, use <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html">
* ModifyEbsDefaultKmsKeyId</a>.</p> <p>If your account is enabled for encryption
* by default, you cannot set this parameter to <code>false</code>. In this case,
* you can omit this parameter.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption">
* Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
*/
inline bool EncryptedHasBeenSet() const { return m_encryptedHasBeenSet; }
/**
* <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot,
* specify <code>true</code>. To create an unencrypted snapshot, omit this
* parameter.</p> <p>If you specify a value for <b>ParentSnapshotId</b>, omit this
* parameter.</p> <p>If you specify <code>true</code>, the snapshot is encrypted
* using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is
* specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no
* default CMK has been specified for your account, the AWS managed CMK is used. To
* set a default CMK for your account, use <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html">
* ModifyEbsDefaultKmsKeyId</a>.</p> <p>If your account is enabled for encryption
* by default, you cannot set this parameter to <code>false</code>. In this case,
* you can omit this parameter.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption">
* Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
*/
inline void SetEncrypted(bool value) { m_encryptedHasBeenSet = true; m_encrypted = value; }
/**
* <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot,
* specify <code>true</code>. To create an unencrypted snapshot, omit this
* parameter.</p> <p>If you specify a value for <b>ParentSnapshotId</b>, omit this
* parameter.</p> <p>If you specify <code>true</code>, the snapshot is encrypted
* using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is
* specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no
* default CMK has been specified for your account, the AWS managed CMK is used. To
* set a default CMK for your account, use <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html">
* ModifyEbsDefaultKmsKeyId</a>.</p> <p>If your account is enabled for encryption
* by default, you cannot set this parameter to <code>false</code>. In this case,
* you can omit this parameter.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption">
* Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
*/
inline StartSnapshotRequest& WithEncrypted(bool value) { SetEncrypted(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline const Aws::String& GetKmsKeyArn() const{ return m_kmsKeyArn; }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline bool KmsKeyArnHasBeenSet() const { return m_kmsKeyArnHasBeenSet; }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline void SetKmsKeyArn(const Aws::String& value) { m_kmsKeyArnHasBeenSet = true; m_kmsKeyArn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline void SetKmsKeyArn(Aws::String&& value) { m_kmsKeyArnHasBeenSet = true; m_kmsKeyArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline void SetKmsKeyArn(const char* value) { m_kmsKeyArnHasBeenSet = true; m_kmsKeyArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline StartSnapshotRequest& WithKmsKeyArn(const Aws::String& value) { SetKmsKeyArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline StartSnapshotRequest& WithKmsKeyArn(Aws::String&& value) { SetKmsKeyArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) to be used to encrypt the snapshot. If you do not
* specify a CMK, the default AWS managed CMK is used.</p> <p>If you specify a
* <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted
* using the same CMK that was used to encrypt the parent snapshot.</p> <p>If
* <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN. </p>
*/
inline StartSnapshotRequest& WithKmsKeyArn(const char* value) { SetKmsKeyArn(value); return *this;}
/**
* <p>The amount of time (in minutes) after which the snapshot is automatically
* cancelled if:</p> <ul> <li> <p>No blocks are written to the snapshot.</p> </li>
* <li> <p>The snapshot is not completed after writing the last block of data.</p>
* </li> </ul> <p>If no value is specified, the timeout defaults to <code>60</code>
* minutes.</p>
*/
inline int GetTimeout() const{ return m_timeout; }
/**
* <p>The amount of time (in minutes) after which the snapshot is automatically
* cancelled if:</p> <ul> <li> <p>No blocks are written to the snapshot.</p> </li>
* <li> <p>The snapshot is not completed after writing the last block of data.</p>
* </li> </ul> <p>If no value is specified, the timeout defaults to <code>60</code>
* minutes.</p>
*/
inline bool TimeoutHasBeenSet() const { return m_timeoutHasBeenSet; }
/**
* <p>The amount of time (in minutes) after which the snapshot is automatically
* cancelled if:</p> <ul> <li> <p>No blocks are written to the snapshot.</p> </li>
* <li> <p>The snapshot is not completed after writing the last block of data.</p>
* </li> </ul> <p>If no value is specified, the timeout defaults to <code>60</code>
* minutes.</p>
*/
inline void SetTimeout(int value) { m_timeoutHasBeenSet = true; m_timeout = value; }
/**
* <p>The amount of time (in minutes) after which the snapshot is automatically
* cancelled if:</p> <ul> <li> <p>No blocks are written to the snapshot.</p> </li>
* <li> <p>The snapshot is not completed after writing the last block of data.</p>
* </li> </ul> <p>If no value is specified, the timeout defaults to <code>60</code>
* minutes.</p>
*/
inline StartSnapshotRequest& WithTimeout(int value) { SetTimeout(value); return *this;}
private:
long long m_volumeSize;
bool m_volumeSizeHasBeenSet;
Aws::String m_parentSnapshotId;
bool m_parentSnapshotIdHasBeenSet;
Aws::Vector<Tag> m_tags;
bool m_tagsHasBeenSet;
Aws::String m_description;
bool m_descriptionHasBeenSet;
Aws::String m_clientToken;
bool m_clientTokenHasBeenSet;
bool m_encrypted;
bool m_encryptedHasBeenSet;
Aws::String m_kmsKeyArn;
bool m_kmsKeyArnHasBeenSet;
int m_timeout;
bool m_timeoutHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,398 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/Status.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/ebs/model/Tag.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
class AWS_EBS_API StartSnapshotResult
{
public:
StartSnapshotResult();
StartSnapshotResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
StartSnapshotResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The description of the snapshot.</p>
*/
inline const Aws::String& GetDescription() const{ return m_description; }
/**
* <p>The description of the snapshot.</p>
*/
inline void SetDescription(const Aws::String& value) { m_description = value; }
/**
* <p>The description of the snapshot.</p>
*/
inline void SetDescription(Aws::String&& value) { m_description = std::move(value); }
/**
* <p>The description of the snapshot.</p>
*/
inline void SetDescription(const char* value) { m_description.assign(value); }
/**
* <p>The description of the snapshot.</p>
*/
inline StartSnapshotResult& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}
/**
* <p>The description of the snapshot.</p>
*/
inline StartSnapshotResult& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}
/**
* <p>The description of the snapshot.</p>
*/
inline StartSnapshotResult& WithDescription(const char* value) { SetDescription(value); return *this;}
/**
* <p>The ID of the snapshot.</p>
*/
inline const Aws::String& GetSnapshotId() const{ return m_snapshotId; }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(const Aws::String& value) { m_snapshotId = value; }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(Aws::String&& value) { m_snapshotId = std::move(value); }
/**
* <p>The ID of the snapshot.</p>
*/
inline void SetSnapshotId(const char* value) { m_snapshotId.assign(value); }
/**
* <p>The ID of the snapshot.</p>
*/
inline StartSnapshotResult& WithSnapshotId(const Aws::String& value) { SetSnapshotId(value); return *this;}
/**
* <p>The ID of the snapshot.</p>
*/
inline StartSnapshotResult& WithSnapshotId(Aws::String&& value) { SetSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the snapshot.</p>
*/
inline StartSnapshotResult& WithSnapshotId(const char* value) { SetSnapshotId(value); return *this;}
/**
* <p>The AWS account ID of the snapshot owner.</p>
*/
inline const Aws::String& GetOwnerId() const{ return m_ownerId; }
/**
* <p>The AWS account ID of the snapshot owner.</p>
*/
inline void SetOwnerId(const Aws::String& value) { m_ownerId = value; }
/**
* <p>The AWS account ID of the snapshot owner.</p>
*/
inline void SetOwnerId(Aws::String&& value) { m_ownerId = std::move(value); }
/**
* <p>The AWS account ID of the snapshot owner.</p>
*/
inline void SetOwnerId(const char* value) { m_ownerId.assign(value); }
/**
* <p>The AWS account ID of the snapshot owner.</p>
*/
inline StartSnapshotResult& WithOwnerId(const Aws::String& value) { SetOwnerId(value); return *this;}
/**
* <p>The AWS account ID of the snapshot owner.</p>
*/
inline StartSnapshotResult& WithOwnerId(Aws::String&& value) { SetOwnerId(std::move(value)); return *this;}
/**
* <p>The AWS account ID of the snapshot owner.</p>
*/
inline StartSnapshotResult& WithOwnerId(const char* value) { SetOwnerId(value); return *this;}
/**
* <p>The status of the snapshot.</p>
*/
inline const Status& GetStatus() const{ return m_status; }
/**
* <p>The status of the snapshot.</p>
*/
inline void SetStatus(const Status& value) { m_status = value; }
/**
* <p>The status of the snapshot.</p>
*/
inline void SetStatus(Status&& value) { m_status = std::move(value); }
/**
* <p>The status of the snapshot.</p>
*/
inline StartSnapshotResult& WithStatus(const Status& value) { SetStatus(value); return *this;}
/**
* <p>The status of the snapshot.</p>
*/
inline StartSnapshotResult& WithStatus(Status&& value) { SetStatus(std::move(value)); return *this;}
/**
* <p>The timestamp when the snapshot was created.</p>
*/
inline const Aws::Utils::DateTime& GetStartTime() const{ return m_startTime; }
/**
* <p>The timestamp when the snapshot was created.</p>
*/
inline void SetStartTime(const Aws::Utils::DateTime& value) { m_startTime = value; }
/**
* <p>The timestamp when the snapshot was created.</p>
*/
inline void SetStartTime(Aws::Utils::DateTime&& value) { m_startTime = std::move(value); }
/**
* <p>The timestamp when the snapshot was created.</p>
*/
inline StartSnapshotResult& WithStartTime(const Aws::Utils::DateTime& value) { SetStartTime(value); return *this;}
/**
* <p>The timestamp when the snapshot was created.</p>
*/
inline StartSnapshotResult& WithStartTime(Aws::Utils::DateTime&& value) { SetStartTime(std::move(value)); return *this;}
/**
* <p>The size of the volume, in GiB.</p>
*/
inline long long GetVolumeSize() const{ return m_volumeSize; }
/**
* <p>The size of the volume, in GiB.</p>
*/
inline void SetVolumeSize(long long value) { m_volumeSize = value; }
/**
* <p>The size of the volume, in GiB.</p>
*/
inline StartSnapshotResult& WithVolumeSize(long long value) { SetVolumeSize(value); return *this;}
/**
* <p>The size of the blocks in the snapshot, in bytes.</p>
*/
inline int GetBlockSize() const{ return m_blockSize; }
/**
* <p>The size of the blocks in the snapshot, in bytes.</p>
*/
inline void SetBlockSize(int value) { m_blockSize = value; }
/**
* <p>The size of the blocks in the snapshot, in bytes.</p>
*/
inline StartSnapshotResult& WithBlockSize(int value) { SetBlockSize(value); return *this;}
/**
* <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
* For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">
* Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }
/**
* <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
* For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">
* Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline void SetTags(const Aws::Vector<Tag>& value) { m_tags = value; }
/**
* <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
* For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">
* Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline void SetTags(Aws::Vector<Tag>&& value) { m_tags = std::move(value); }
/**
* <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
* For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">
* Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline StartSnapshotResult& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}
/**
* <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
* For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">
* Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline StartSnapshotResult& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}
/**
* <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
* For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">
* Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline StartSnapshotResult& AddTags(const Tag& value) { m_tags.push_back(value); return *this; }
/**
* <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
* For more information, see <a
* href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">
* Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud
* User Guide</i>.</p>
*/
inline StartSnapshotResult& AddTags(Tag&& value) { m_tags.push_back(std::move(value)); return *this; }
/**
* <p>The ID of the parent snapshot.</p>
*/
inline const Aws::String& GetParentSnapshotId() const{ return m_parentSnapshotId; }
/**
* <p>The ID of the parent snapshot.</p>
*/
inline void SetParentSnapshotId(const Aws::String& value) { m_parentSnapshotId = value; }
/**
* <p>The ID of the parent snapshot.</p>
*/
inline void SetParentSnapshotId(Aws::String&& value) { m_parentSnapshotId = std::move(value); }
/**
* <p>The ID of the parent snapshot.</p>
*/
inline void SetParentSnapshotId(const char* value) { m_parentSnapshotId.assign(value); }
/**
* <p>The ID of the parent snapshot.</p>
*/
inline StartSnapshotResult& WithParentSnapshotId(const Aws::String& value) { SetParentSnapshotId(value); return *this;}
/**
* <p>The ID of the parent snapshot.</p>
*/
inline StartSnapshotResult& WithParentSnapshotId(Aws::String&& value) { SetParentSnapshotId(std::move(value)); return *this;}
/**
* <p>The ID of the parent snapshot.</p>
*/
inline StartSnapshotResult& WithParentSnapshotId(const char* value) { SetParentSnapshotId(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) used to encrypt the snapshot.</p>
*/
inline const Aws::String& GetKmsKeyArn() const{ return m_kmsKeyArn; }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) used to encrypt the snapshot.</p>
*/
inline void SetKmsKeyArn(const Aws::String& value) { m_kmsKeyArn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) used to encrypt the snapshot.</p>
*/
inline void SetKmsKeyArn(Aws::String&& value) { m_kmsKeyArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) used to encrypt the snapshot.</p>
*/
inline void SetKmsKeyArn(const char* value) { m_kmsKeyArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) used to encrypt the snapshot.</p>
*/
inline StartSnapshotResult& WithKmsKeyArn(const Aws::String& value) { SetKmsKeyArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) used to encrypt the snapshot.</p>
*/
inline StartSnapshotResult& WithKmsKeyArn(Aws::String&& value) { SetKmsKeyArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
* customer master key (CMK) used to encrypt the snapshot.</p>
*/
inline StartSnapshotResult& WithKmsKeyArn(const char* value) { SetKmsKeyArn(value); return *this;}
private:
Aws::String m_description;
Aws::String m_snapshotId;
Aws::String m_ownerId;
Status m_status;
Aws::Utils::DateTime m_startTime;
long long m_volumeSize;
int m_blockSize;
Aws::Vector<Tag> m_tags;
Aws::String m_parentSnapshotId;
Aws::String m_kmsKeyArn;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,32 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class Status
{
NOT_SET,
completed,
pending,
error
};
namespace StatusMapper
{
AWS_EBS_API Status GetStatusForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForStatus(Status value);
} // namespace StatusMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,132 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>Describes a tag.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/Tag">AWS API
* Reference</a></p>
*/
class AWS_EBS_API Tag
{
public:
Tag();
Tag(Aws::Utils::Json::JsonView jsonValue);
Tag& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The key of the tag.</p>
*/
inline const Aws::String& GetKey() const{ return m_key; }
/**
* <p>The key of the tag.</p>
*/
inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; }
/**
* <p>The key of the tag.</p>
*/
inline void SetKey(const Aws::String& value) { m_keyHasBeenSet = true; m_key = value; }
/**
* <p>The key of the tag.</p>
*/
inline void SetKey(Aws::String&& value) { m_keyHasBeenSet = true; m_key = std::move(value); }
/**
* <p>The key of the tag.</p>
*/
inline void SetKey(const char* value) { m_keyHasBeenSet = true; m_key.assign(value); }
/**
* <p>The key of the tag.</p>
*/
inline Tag& WithKey(const Aws::String& value) { SetKey(value); return *this;}
/**
* <p>The key of the tag.</p>
*/
inline Tag& WithKey(Aws::String&& value) { SetKey(std::move(value)); return *this;}
/**
* <p>The key of the tag.</p>
*/
inline Tag& WithKey(const char* value) { SetKey(value); return *this;}
/**
* <p>The value of the tag.</p>
*/
inline const Aws::String& GetValue() const{ return m_value; }
/**
* <p>The value of the tag.</p>
*/
inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
/**
* <p>The value of the tag.</p>
*/
inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; }
/**
* <p>The value of the tag.</p>
*/
inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); }
/**
* <p>The value of the tag.</p>
*/
inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); }
/**
* <p>The value of the tag.</p>
*/
inline Tag& WithValue(const Aws::String& value) { SetValue(value); return *this;}
/**
* <p>The value of the tag.</p>
*/
inline Tag& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;}
/**
* <p>The value of the tag.</p>
*/
inline Tag& WithValue(const char* value) { SetValue(value); return *this;}
private:
Aws::String m_key;
bool m_keyHasBeenSet;
Aws::String m_value;
bool m_valueHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,108 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ebs/model/ValidationExceptionReason.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace EBS
{
namespace Model
{
/**
* <p>The input fails to satisfy the constraints of the EBS direct
* APIs.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ValidationException">AWS
* API Reference</a></p>
*/
class AWS_EBS_API ValidationException
{
public:
ValidationException();
ValidationException(Aws::Utils::Json::JsonView jsonValue);
ValidationException& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
inline const Aws::String& GetMessage() const{ return m_message; }
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
inline ValidationException& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
inline ValidationException& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
inline ValidationException& WithMessage(const char* value) { SetMessage(value); return *this;}
/**
* <p>The reason for the validation exception.</p>
*/
inline const ValidationExceptionReason& GetReason() const{ return m_reason; }
/**
* <p>The reason for the validation exception.</p>
*/
inline bool ReasonHasBeenSet() const { return m_reasonHasBeenSet; }
/**
* <p>The reason for the validation exception.</p>
*/
inline void SetReason(const ValidationExceptionReason& value) { m_reasonHasBeenSet = true; m_reason = value; }
/**
* <p>The reason for the validation exception.</p>
*/
inline void SetReason(ValidationExceptionReason&& value) { m_reasonHasBeenSet = true; m_reason = std::move(value); }
/**
* <p>The reason for the validation exception.</p>
*/
inline ValidationException& WithReason(const ValidationExceptionReason& value) { SetReason(value); return *this;}
/**
* <p>The reason for the validation exception.</p>
*/
inline ValidationException& WithReason(ValidationExceptionReason&& value) { SetReason(std::move(value)); return *this;}
private:
Aws::String m_message;
bool m_messageHasBeenSet;
ValidationExceptionReason m_reason;
bool m_reasonHasBeenSet;
};
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ebs/EBS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EBS
{
namespace Model
{
enum class ValidationExceptionReason
{
NOT_SET,
INVALID_CUSTOMER_KEY,
INVALID_PAGE_TOKEN,
INVALID_BLOCK_TOKEN,
INVALID_SNAPSHOT_ID,
UNRELATED_SNAPSHOTS,
INVALID_BLOCK,
INVALID_CONTENT_ENCODING,
INVALID_TAG,
INVALID_DEPENDENCY_REQUEST,
INVALID_PARAMETER_VALUE,
INVALID_VOLUME_SIZE
};
namespace ValidationExceptionReasonMapper
{
AWS_EBS_API ValidationExceptionReason GetValidationExceptionReasonForName(const Aws::String& name);
AWS_EBS_API Aws::String GetNameForValidationExceptionReason(ValidationExceptionReason value);
} // namespace ValidationExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,335 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/utils/Outcome.h>
#include <aws/core/auth/AWSAuthSigner.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/core/client/RetryStrategy.h>
#include <aws/core/http/HttpClient.h>
#include <aws/core/http/HttpResponse.h>
#include <aws/core/http/HttpClientFactory.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/core/utils/DNS.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/ebs/EBSClient.h>
#include <aws/ebs/EBSEndpoint.h>
#include <aws/ebs/EBSErrorMarshaller.h>
#include <aws/ebs/model/CompleteSnapshotRequest.h>
#include <aws/ebs/model/GetSnapshotBlockRequest.h>
#include <aws/ebs/model/ListChangedBlocksRequest.h>
#include <aws/ebs/model/ListSnapshotBlocksRequest.h>
#include <aws/ebs/model/PutSnapshotBlockRequest.h>
#include <aws/ebs/model/StartSnapshotRequest.h>
using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::EBS;
using namespace Aws::EBS::Model;
using namespace Aws::Http;
using namespace Aws::Utils::Json;
static const char* SERVICE_NAME = "ebs";
static const char* ALLOCATION_TAG = "EBSClient";
EBSClient::EBSClient(const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<EBSErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
EBSClient::EBSClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<EBSErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
EBSClient::EBSClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<EBSErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
EBSClient::~EBSClient()
{
}
void EBSClient::init(const ClientConfiguration& config)
{
SetServiceClientName("EBS");
m_configScheme = SchemeMapper::ToString(config.scheme);
if (config.endpointOverride.empty())
{
m_uri = m_configScheme + "://" + EBSEndpoint::ForRegion(config.region, config.useDualStack);
}
else
{
OverrideEndpoint(config.endpointOverride);
}
}
void EBSClient::OverrideEndpoint(const Aws::String& endpoint)
{
if (endpoint.compare(0, 7, "http://") == 0 || endpoint.compare(0, 8, "https://") == 0)
{
m_uri = endpoint;
}
else
{
m_uri = m_configScheme + "://" + endpoint;
}
}
CompleteSnapshotOutcome EBSClient::CompleteSnapshot(const CompleteSnapshotRequest& request) const
{
if (!request.SnapshotIdHasBeenSet())
{
AWS_LOGSTREAM_ERROR("CompleteSnapshot", "Required field: SnapshotId, is not set");
return CompleteSnapshotOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SnapshotId]", false));
}
if (!request.ChangedBlocksCountHasBeenSet())
{
AWS_LOGSTREAM_ERROR("CompleteSnapshot", "Required field: ChangedBlocksCount, is not set");
return CompleteSnapshotOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ChangedBlocksCount]", false));
}
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/snapshots/completion/";
ss << request.GetSnapshotId();
uri.SetPath(uri.GetPath() + ss.str());
return CompleteSnapshotOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
CompleteSnapshotOutcomeCallable EBSClient::CompleteSnapshotCallable(const CompleteSnapshotRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< CompleteSnapshotOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CompleteSnapshot(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void EBSClient::CompleteSnapshotAsync(const CompleteSnapshotRequest& request, const CompleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->CompleteSnapshotAsyncHelper( request, handler, context ); } );
}
void EBSClient::CompleteSnapshotAsyncHelper(const CompleteSnapshotRequest& request, const CompleteSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, CompleteSnapshot(request), context);
}
GetSnapshotBlockOutcome EBSClient::GetSnapshotBlock(const GetSnapshotBlockRequest& request) const
{
if (!request.SnapshotIdHasBeenSet())
{
AWS_LOGSTREAM_ERROR("GetSnapshotBlock", "Required field: SnapshotId, is not set");
return GetSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SnapshotId]", false));
}
if (!request.BlockIndexHasBeenSet())
{
AWS_LOGSTREAM_ERROR("GetSnapshotBlock", "Required field: BlockIndex, is not set");
return GetSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlockIndex]", false));
}
if (!request.BlockTokenHasBeenSet())
{
AWS_LOGSTREAM_ERROR("GetSnapshotBlock", "Required field: BlockToken, is not set");
return GetSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlockToken]", false));
}
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/snapshots/";
ss << request.GetSnapshotId();
ss << "/blocks/";
ss << request.GetBlockIndex();
uri.SetPath(uri.GetPath() + ss.str());
return GetSnapshotBlockOutcome(MakeRequestWithUnparsedResponse(uri, request, Aws::Http::HttpMethod::HTTP_GET));
}
GetSnapshotBlockOutcomeCallable EBSClient::GetSnapshotBlockCallable(const GetSnapshotBlockRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< GetSnapshotBlockOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetSnapshotBlock(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void EBSClient::GetSnapshotBlockAsync(const GetSnapshotBlockRequest& request, const GetSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->GetSnapshotBlockAsyncHelper( request, handler, context ); } );
}
void EBSClient::GetSnapshotBlockAsyncHelper(const GetSnapshotBlockRequest& request, const GetSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, GetSnapshotBlock(request), context);
}
ListChangedBlocksOutcome EBSClient::ListChangedBlocks(const ListChangedBlocksRequest& request) const
{
if (!request.SecondSnapshotIdHasBeenSet())
{
AWS_LOGSTREAM_ERROR("ListChangedBlocks", "Required field: SecondSnapshotId, is not set");
return ListChangedBlocksOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SecondSnapshotId]", false));
}
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/snapshots/";
ss << request.GetSecondSnapshotId();
ss << "/changedblocks";
uri.SetPath(uri.GetPath() + ss.str());
return ListChangedBlocksOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}
ListChangedBlocksOutcomeCallable EBSClient::ListChangedBlocksCallable(const ListChangedBlocksRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< ListChangedBlocksOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListChangedBlocks(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void EBSClient::ListChangedBlocksAsync(const ListChangedBlocksRequest& request, const ListChangedBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->ListChangedBlocksAsyncHelper( request, handler, context ); } );
}
void EBSClient::ListChangedBlocksAsyncHelper(const ListChangedBlocksRequest& request, const ListChangedBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, ListChangedBlocks(request), context);
}
ListSnapshotBlocksOutcome EBSClient::ListSnapshotBlocks(const ListSnapshotBlocksRequest& request) const
{
if (!request.SnapshotIdHasBeenSet())
{
AWS_LOGSTREAM_ERROR("ListSnapshotBlocks", "Required field: SnapshotId, is not set");
return ListSnapshotBlocksOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SnapshotId]", false));
}
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/snapshots/";
ss << request.GetSnapshotId();
ss << "/blocks";
uri.SetPath(uri.GetPath() + ss.str());
return ListSnapshotBlocksOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
}
ListSnapshotBlocksOutcomeCallable EBSClient::ListSnapshotBlocksCallable(const ListSnapshotBlocksRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< ListSnapshotBlocksOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListSnapshotBlocks(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void EBSClient::ListSnapshotBlocksAsync(const ListSnapshotBlocksRequest& request, const ListSnapshotBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->ListSnapshotBlocksAsyncHelper( request, handler, context ); } );
}
void EBSClient::ListSnapshotBlocksAsyncHelper(const ListSnapshotBlocksRequest& request, const ListSnapshotBlocksResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, ListSnapshotBlocks(request), context);
}
PutSnapshotBlockOutcome EBSClient::PutSnapshotBlock(const PutSnapshotBlockRequest& request) const
{
if (!request.SnapshotIdHasBeenSet())
{
AWS_LOGSTREAM_ERROR("PutSnapshotBlock", "Required field: SnapshotId, is not set");
return PutSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SnapshotId]", false));
}
if (!request.BlockIndexHasBeenSet())
{
AWS_LOGSTREAM_ERROR("PutSnapshotBlock", "Required field: BlockIndex, is not set");
return PutSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [BlockIndex]", false));
}
if (!request.DataLengthHasBeenSet())
{
AWS_LOGSTREAM_ERROR("PutSnapshotBlock", "Required field: DataLength, is not set");
return PutSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DataLength]", false));
}
if (!request.ChecksumHasBeenSet())
{
AWS_LOGSTREAM_ERROR("PutSnapshotBlock", "Required field: Checksum, is not set");
return PutSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Checksum]", false));
}
if (!request.ChecksumAlgorithmHasBeenSet())
{
AWS_LOGSTREAM_ERROR("PutSnapshotBlock", "Required field: ChecksumAlgorithm, is not set");
return PutSnapshotBlockOutcome(Aws::Client::AWSError<EBSErrors>(EBSErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ChecksumAlgorithm]", false));
}
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/snapshots/";
ss << request.GetSnapshotId();
ss << "/blocks/";
ss << request.GetBlockIndex();
uri.SetPath(uri.GetPath() + ss.str());
return PutSnapshotBlockOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER));
}
PutSnapshotBlockOutcomeCallable EBSClient::PutSnapshotBlockCallable(const PutSnapshotBlockRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< PutSnapshotBlockOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutSnapshotBlock(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void EBSClient::PutSnapshotBlockAsync(const PutSnapshotBlockRequest& request, const PutSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->PutSnapshotBlockAsyncHelper( request, handler, context ); } );
}
void EBSClient::PutSnapshotBlockAsyncHelper(const PutSnapshotBlockRequest& request, const PutSnapshotBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, PutSnapshotBlock(request), context);
}
StartSnapshotOutcome EBSClient::StartSnapshot(const StartSnapshotRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/snapshots";
uri.SetPath(uri.GetPath() + ss.str());
return StartSnapshotOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
}
StartSnapshotOutcomeCallable EBSClient::StartSnapshotCallable(const StartSnapshotRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< StartSnapshotOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->StartSnapshot(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void EBSClient::StartSnapshotAsync(const StartSnapshotRequest& request, const StartSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->StartSnapshotAsyncHelper( request, handler, context ); } );
}
void EBSClient::StartSnapshotAsyncHelper(const StartSnapshotRequest& request, const StartSnapshotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, StartSnapshot(request), context);
}

View File

@@ -0,0 +1,64 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/EBSEndpoint.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/HashingUtils.h>
using namespace Aws;
using namespace Aws::EBS;
namespace Aws
{
namespace EBS
{
namespace EBSEndpoint
{
static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString("cn-north-1");
static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString("cn-northwest-1");
static const int US_ISO_EAST_1_HASH = Aws::Utils::HashingUtils::HashString("us-iso-east-1");
static const int US_ISOB_EAST_1_HASH = Aws::Utils::HashingUtils::HashString("us-isob-east-1");
Aws::String ForRegion(const Aws::String& regionName, bool useDualStack)
{
// Fallback to us-east-1 if global endpoint does not exists.
Aws::String region = regionName == Aws::Region::AWS_GLOBAL ? Aws::Region::US_EAST_1 : regionName;
auto hash = Aws::Utils::HashingUtils::HashString(region.c_str());
Aws::StringStream ss;
ss << "ebs" << ".";
if(useDualStack)
{
ss << "dualstack.";
}
ss << region;
if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH)
{
ss << ".amazonaws.com.cn";
}
else if (hash == US_ISO_EAST_1_HASH)
{
ss << ".c2s.ic.gov";
}
else if (hash == US_ISOB_EAST_1_HASH)
{
ss << ".sc2s.sgov.gov";
}
else
{
ss << ".amazonaws.com";
}
return ss.str();
}
} // namespace EBSEndpoint
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,22 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/client/AWSError.h>
#include <aws/ebs/EBSErrorMarshaller.h>
#include <aws/ebs/EBSErrors.h>
using namespace Aws::Client;
using namespace Aws::EBS;
AWSError<CoreErrors> EBSErrorMarshaller::FindErrorByName(const char* errorName) const
{
AWSError<CoreErrors> error = EBSErrorMapper::GetErrorForName(errorName);
if(error.GetErrorType() != CoreErrors::UNKNOWN)
{
return error;
}
return AWSErrorMarshaller::FindErrorByName(errorName);
}

View File

@@ -0,0 +1,88 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/ebs/EBSErrors.h>
#include <aws/ebs/model/RequestThrottledException.h>
#include <aws/ebs/model/ServiceQuotaExceededException.h>
#include <aws/ebs/model/ResourceNotFoundException.h>
#include <aws/ebs/model/ValidationException.h>
#include <aws/ebs/model/AccessDeniedException.h>
using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::EBS;
using namespace Aws::EBS::Model;
namespace Aws
{
namespace EBS
{
template<> AWS_EBS_API RequestThrottledException EBSError::GetModeledError()
{
assert(this->GetErrorType() == EBSErrors::THROTTLING);
return RequestThrottledException(this->GetJsonPayload().View());
}
template<> AWS_EBS_API ServiceQuotaExceededException EBSError::GetModeledError()
{
assert(this->GetErrorType() == EBSErrors::SERVICE_QUOTA_EXCEEDED);
return ServiceQuotaExceededException(this->GetJsonPayload().View());
}
template<> AWS_EBS_API ResourceNotFoundException EBSError::GetModeledError()
{
assert(this->GetErrorType() == EBSErrors::RESOURCE_NOT_FOUND);
return ResourceNotFoundException(this->GetJsonPayload().View());
}
template<> AWS_EBS_API ValidationException EBSError::GetModeledError()
{
assert(this->GetErrorType() == EBSErrors::VALIDATION);
return ValidationException(this->GetJsonPayload().View());
}
template<> AWS_EBS_API AccessDeniedException EBSError::GetModeledError()
{
assert(this->GetErrorType() == EBSErrors::ACCESS_DENIED);
return AccessDeniedException(this->GetJsonPayload().View());
}
namespace EBSErrorMapper
{
static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException");
static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException");
static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException");
static const int CONCURRENT_LIMIT_EXCEEDED_HASH = HashingUtils::HashString("ConcurrentLimitExceededException");
AWSError<CoreErrors> GetErrorForName(const char* errorName)
{
int hashCode = HashingUtils::HashString(errorName);
if (hashCode == CONFLICT_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(EBSErrors::CONFLICT), false);
}
else if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(EBSErrors::SERVICE_QUOTA_EXCEEDED), false);
}
else if (hashCode == INTERNAL_SERVER_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(EBSErrors::INTERNAL_SERVER), false);
}
else if (hashCode == CONCURRENT_LIMIT_EXCEEDED_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(EBSErrors::CONCURRENT_LIMIT_EXCEEDED), false);
}
return AWSError<CoreErrors>(CoreErrors::UNKNOWN, false);
}
} // namespace EBSErrorMapper
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/AccessDeniedException.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
AccessDeniedException::AccessDeniedException() :
m_messageHasBeenSet(false),
m_reason(AccessDeniedExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
}
AccessDeniedException::AccessDeniedException(JsonView jsonValue) :
m_messageHasBeenSet(false),
m_reason(AccessDeniedExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
*this = jsonValue;
}
AccessDeniedException& AccessDeniedException::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Message"))
{
m_message = jsonValue.GetString("Message");
m_messageHasBeenSet = true;
}
if(jsonValue.ValueExists("Reason"))
{
m_reason = AccessDeniedExceptionReasonMapper::GetAccessDeniedExceptionReasonForName(jsonValue.GetString("Reason"));
m_reasonHasBeenSet = true;
}
return *this;
}
JsonValue AccessDeniedException::Jsonize() const
{
JsonValue payload;
if(m_messageHasBeenSet)
{
payload.WithString("Message", m_message);
}
if(m_reasonHasBeenSet)
{
payload.WithString("Reason", AccessDeniedExceptionReasonMapper::GetNameForAccessDeniedExceptionReason(m_reason));
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/AccessDeniedExceptionReason.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace AccessDeniedExceptionReasonMapper
{
static const int UNAUTHORIZED_ACCOUNT_HASH = HashingUtils::HashString("UNAUTHORIZED_ACCOUNT");
static const int DEPENDENCY_ACCESS_DENIED_HASH = HashingUtils::HashString("DEPENDENCY_ACCESS_DENIED");
AccessDeniedExceptionReason GetAccessDeniedExceptionReasonForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == UNAUTHORIZED_ACCOUNT_HASH)
{
return AccessDeniedExceptionReason::UNAUTHORIZED_ACCOUNT;
}
else if (hashCode == DEPENDENCY_ACCESS_DENIED_HASH)
{
return AccessDeniedExceptionReason::DEPENDENCY_ACCESS_DENIED;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<AccessDeniedExceptionReason>(hashCode);
}
return AccessDeniedExceptionReason::NOT_SET;
}
Aws::String GetNameForAccessDeniedExceptionReason(AccessDeniedExceptionReason enumValue)
{
switch(enumValue)
{
case AccessDeniedExceptionReason::UNAUTHORIZED_ACCOUNT:
return "UNAUTHORIZED_ACCOUNT";
case AccessDeniedExceptionReason::DEPENDENCY_ACCESS_DENIED:
return "DEPENDENCY_ACCESS_DENIED";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace AccessDeniedExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,76 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/Block.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
Block::Block() :
m_blockIndex(0),
m_blockIndexHasBeenSet(false),
m_blockTokenHasBeenSet(false)
{
}
Block::Block(JsonView jsonValue) :
m_blockIndex(0),
m_blockIndexHasBeenSet(false),
m_blockTokenHasBeenSet(false)
{
*this = jsonValue;
}
Block& Block::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("BlockIndex"))
{
m_blockIndex = jsonValue.GetInteger("BlockIndex");
m_blockIndexHasBeenSet = true;
}
if(jsonValue.ValueExists("BlockToken"))
{
m_blockToken = jsonValue.GetString("BlockToken");
m_blockTokenHasBeenSet = true;
}
return *this;
}
JsonValue Block::Jsonize() const
{
JsonValue payload;
if(m_blockIndexHasBeenSet)
{
payload.WithInteger("BlockIndex", m_blockIndex);
}
if(m_blockTokenHasBeenSet)
{
payload.WithString("BlockToken", m_blockToken);
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,91 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ChangedBlock.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
ChangedBlock::ChangedBlock() :
m_blockIndex(0),
m_blockIndexHasBeenSet(false),
m_firstBlockTokenHasBeenSet(false),
m_secondBlockTokenHasBeenSet(false)
{
}
ChangedBlock::ChangedBlock(JsonView jsonValue) :
m_blockIndex(0),
m_blockIndexHasBeenSet(false),
m_firstBlockTokenHasBeenSet(false),
m_secondBlockTokenHasBeenSet(false)
{
*this = jsonValue;
}
ChangedBlock& ChangedBlock::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("BlockIndex"))
{
m_blockIndex = jsonValue.GetInteger("BlockIndex");
m_blockIndexHasBeenSet = true;
}
if(jsonValue.ValueExists("FirstBlockToken"))
{
m_firstBlockToken = jsonValue.GetString("FirstBlockToken");
m_firstBlockTokenHasBeenSet = true;
}
if(jsonValue.ValueExists("SecondBlockToken"))
{
m_secondBlockToken = jsonValue.GetString("SecondBlockToken");
m_secondBlockTokenHasBeenSet = true;
}
return *this;
}
JsonValue ChangedBlock::Jsonize() const
{
JsonValue payload;
if(m_blockIndexHasBeenSet)
{
payload.WithInteger("BlockIndex", m_blockIndex);
}
if(m_firstBlockTokenHasBeenSet)
{
payload.WithString("FirstBlockToken", m_firstBlockToken);
}
if(m_secondBlockTokenHasBeenSet)
{
payload.WithString("SecondBlockToken", m_secondBlockToken);
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,63 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ChecksumAggregationMethod.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace ChecksumAggregationMethodMapper
{
static const int LINEAR_HASH = HashingUtils::HashString("LINEAR");
ChecksumAggregationMethod GetChecksumAggregationMethodForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == LINEAR_HASH)
{
return ChecksumAggregationMethod::LINEAR;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ChecksumAggregationMethod>(hashCode);
}
return ChecksumAggregationMethod::NOT_SET;
}
Aws::String GetNameForChecksumAggregationMethod(ChecksumAggregationMethod enumValue)
{
switch(enumValue)
{
case ChecksumAggregationMethod::LINEAR:
return "LINEAR";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ChecksumAggregationMethodMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,63 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ChecksumAlgorithm.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace ChecksumAlgorithmMapper
{
static const int SHA256_HASH = HashingUtils::HashString("SHA256");
ChecksumAlgorithm GetChecksumAlgorithmForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == SHA256_HASH)
{
return ChecksumAlgorithm::SHA256;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ChecksumAlgorithm>(hashCode);
}
return ChecksumAlgorithm::NOT_SET;
}
Aws::String GetNameForChecksumAlgorithm(ChecksumAlgorithm enumValue)
{
switch(enumValue)
{
case ChecksumAlgorithm::SHA256:
return "SHA256";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ChecksumAlgorithmMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,67 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/CompleteSnapshotRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CompleteSnapshotRequest::CompleteSnapshotRequest() :
m_snapshotIdHasBeenSet(false),
m_changedBlocksCount(0),
m_changedBlocksCountHasBeenSet(false),
m_checksumHasBeenSet(false),
m_checksumAlgorithm(ChecksumAlgorithm::NOT_SET),
m_checksumAlgorithmHasBeenSet(false),
m_checksumAggregationMethod(ChecksumAggregationMethod::NOT_SET),
m_checksumAggregationMethodHasBeenSet(false)
{
}
Aws::String CompleteSnapshotRequest::SerializePayload() const
{
return {};
}
Aws::Http::HeaderValueCollection CompleteSnapshotRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
Aws::StringStream ss;
if(m_changedBlocksCountHasBeenSet)
{
ss << m_changedBlocksCount;
headers.emplace("x-amz-changedblockscount", ss.str());
ss.str("");
}
if(m_checksumHasBeenSet)
{
ss << m_checksum;
headers.emplace("x-amz-checksum", ss.str());
ss.str("");
}
if(m_checksumAlgorithmHasBeenSet)
{
headers.emplace("x-amz-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm));
}
if(m_checksumAggregationMethodHasBeenSet)
{
headers.emplace("x-amz-checksum-aggregation-method", ChecksumAggregationMethodMapper::GetNameForChecksumAggregationMethod(m_checksumAggregationMethod));
}
return headers;
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/CompleteSnapshotResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
CompleteSnapshotResult::CompleteSnapshotResult() :
m_status(Status::NOT_SET)
{
}
CompleteSnapshotResult::CompleteSnapshotResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_status(Status::NOT_SET)
{
*this = result;
}
CompleteSnapshotResult& CompleteSnapshotResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Status"))
{
m_status = StatusMapper::GetStatusForName(jsonValue.GetString("Status"));
}
return *this;
}

View File

@@ -0,0 +1,44 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/GetSnapshotBlockRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
GetSnapshotBlockRequest::GetSnapshotBlockRequest() :
m_snapshotIdHasBeenSet(false),
m_blockIndex(0),
m_blockIndexHasBeenSet(false),
m_blockTokenHasBeenSet(false)
{
}
Aws::String GetSnapshotBlockRequest::SerializePayload() const
{
return {};
}
void GetSnapshotBlockRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_blockTokenHasBeenSet)
{
ss << m_blockToken;
uri.AddQueryStringParameter("blockToken", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,79 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/GetSnapshotBlockResult.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/HashingUtils.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Stream;
using namespace Aws::Utils;
using namespace Aws;
GetSnapshotBlockResult::GetSnapshotBlockResult() :
m_dataLength(0),
m_checksumAlgorithm(ChecksumAlgorithm::NOT_SET)
{
}
GetSnapshotBlockResult::GetSnapshotBlockResult(GetSnapshotBlockResult&& toMove) :
m_dataLength(toMove.m_dataLength),
m_blockData(std::move(toMove.m_blockData)),
m_checksum(std::move(toMove.m_checksum)),
m_checksumAlgorithm(toMove.m_checksumAlgorithm)
{
}
GetSnapshotBlockResult& GetSnapshotBlockResult::operator=(GetSnapshotBlockResult&& toMove)
{
if(this == &toMove)
{
return *this;
}
m_dataLength = toMove.m_dataLength;
m_blockData = std::move(toMove.m_blockData);
m_checksum = std::move(toMove.m_checksum);
m_checksumAlgorithm = toMove.m_checksumAlgorithm;
return *this;
}
GetSnapshotBlockResult::GetSnapshotBlockResult(Aws::AmazonWebServiceResult<ResponseStream>&& result) :
m_dataLength(0),
m_checksumAlgorithm(ChecksumAlgorithm::NOT_SET)
{
*this = std::move(result);
}
GetSnapshotBlockResult& GetSnapshotBlockResult::operator =(Aws::AmazonWebServiceResult<ResponseStream>&& result)
{
m_blockData = result.TakeOwnershipOfPayload();
const auto& headers = result.GetHeaderValueCollection();
const auto& dataLengthIter = headers.find("x-amz-data-length");
if(dataLengthIter != headers.end())
{
m_dataLength = StringUtils::ConvertToInt32(dataLengthIter->second.c_str());
}
const auto& checksumIter = headers.find("x-amz-checksum");
if(checksumIter != headers.end())
{
m_checksum = checksumIter->second;
}
const auto& checksumAlgorithmIter = headers.find("x-amz-checksum-algorithm");
if(checksumAlgorithmIter != headers.end())
{
m_checksumAlgorithm = ChecksumAlgorithmMapper::GetChecksumAlgorithmForName(checksumAlgorithmIter->second);
}
return *this;
}

View File

@@ -0,0 +1,68 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ListChangedBlocksRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
ListChangedBlocksRequest::ListChangedBlocksRequest() :
m_firstSnapshotIdHasBeenSet(false),
m_secondSnapshotIdHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false),
m_startingBlockIndex(0),
m_startingBlockIndexHasBeenSet(false)
{
}
Aws::String ListChangedBlocksRequest::SerializePayload() const
{
return {};
}
void ListChangedBlocksRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_firstSnapshotIdHasBeenSet)
{
ss << m_firstSnapshotId;
uri.AddQueryStringParameter("firstSnapshotId", ss.str());
ss.str("");
}
if(m_nextTokenHasBeenSet)
{
ss << m_nextToken;
uri.AddQueryStringParameter("pageToken", ss.str());
ss.str("");
}
if(m_maxResultsHasBeenSet)
{
ss << m_maxResults;
uri.AddQueryStringParameter("maxResults", ss.str());
ss.str("");
}
if(m_startingBlockIndexHasBeenSet)
{
ss << m_startingBlockIndex;
uri.AddQueryStringParameter("startingBlockIndex", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,71 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ListChangedBlocksResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListChangedBlocksResult::ListChangedBlocksResult() :
m_volumeSize(0),
m_blockSize(0)
{
}
ListChangedBlocksResult::ListChangedBlocksResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_volumeSize(0),
m_blockSize(0)
{
*this = result;
}
ListChangedBlocksResult& ListChangedBlocksResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("ChangedBlocks"))
{
Array<JsonView> changedBlocksJsonList = jsonValue.GetArray("ChangedBlocks");
for(unsigned changedBlocksIndex = 0; changedBlocksIndex < changedBlocksJsonList.GetLength(); ++changedBlocksIndex)
{
m_changedBlocks.push_back(changedBlocksJsonList[changedBlocksIndex].AsObject());
}
}
if(jsonValue.ValueExists("ExpiryTime"))
{
m_expiryTime = jsonValue.GetDouble("ExpiryTime");
}
if(jsonValue.ValueExists("VolumeSize"))
{
m_volumeSize = jsonValue.GetInt64("VolumeSize");
}
if(jsonValue.ValueExists("BlockSize"))
{
m_blockSize = jsonValue.GetInteger("BlockSize");
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}

View File

@@ -0,0 +1,60 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ListSnapshotBlocksRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
ListSnapshotBlocksRequest::ListSnapshotBlocksRequest() :
m_snapshotIdHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false),
m_startingBlockIndex(0),
m_startingBlockIndexHasBeenSet(false)
{
}
Aws::String ListSnapshotBlocksRequest::SerializePayload() const
{
return {};
}
void ListSnapshotBlocksRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_nextTokenHasBeenSet)
{
ss << m_nextToken;
uri.AddQueryStringParameter("pageToken", ss.str());
ss.str("");
}
if(m_maxResultsHasBeenSet)
{
ss << m_maxResults;
uri.AddQueryStringParameter("maxResults", ss.str());
ss.str("");
}
if(m_startingBlockIndexHasBeenSet)
{
ss << m_startingBlockIndex;
uri.AddQueryStringParameter("startingBlockIndex", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,71 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ListSnapshotBlocksResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListSnapshotBlocksResult::ListSnapshotBlocksResult() :
m_volumeSize(0),
m_blockSize(0)
{
}
ListSnapshotBlocksResult::ListSnapshotBlocksResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_volumeSize(0),
m_blockSize(0)
{
*this = result;
}
ListSnapshotBlocksResult& ListSnapshotBlocksResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Blocks"))
{
Array<JsonView> blocksJsonList = jsonValue.GetArray("Blocks");
for(unsigned blocksIndex = 0; blocksIndex < blocksJsonList.GetLength(); ++blocksIndex)
{
m_blocks.push_back(blocksJsonList[blocksIndex].AsObject());
}
}
if(jsonValue.ValueExists("ExpiryTime"))
{
m_expiryTime = jsonValue.GetDouble("ExpiryTime");
}
if(jsonValue.ValueExists("VolumeSize"))
{
m_volumeSize = jsonValue.GetInt64("VolumeSize");
}
if(jsonValue.ValueExists("BlockSize"))
{
m_blockSize = jsonValue.GetInteger("BlockSize");
}
if(jsonValue.ValueExists("NextToken"))
{
m_nextToken = jsonValue.GetString("NextToken");
}
return *this;
}

View File

@@ -0,0 +1,66 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/PutSnapshotBlockRequest.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Stream;
using namespace Aws::Utils;
using namespace Aws;
PutSnapshotBlockRequest::PutSnapshotBlockRequest() :
m_snapshotIdHasBeenSet(false),
m_blockIndex(0),
m_blockIndexHasBeenSet(false),
m_dataLength(0),
m_dataLengthHasBeenSet(false),
m_progress(0),
m_progressHasBeenSet(false),
m_checksumHasBeenSet(false),
m_checksumAlgorithm(ChecksumAlgorithm::NOT_SET),
m_checksumAlgorithmHasBeenSet(false)
{
}
Aws::Http::HeaderValueCollection PutSnapshotBlockRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
Aws::StringStream ss;
if(m_dataLengthHasBeenSet)
{
ss << m_dataLength;
headers.emplace("x-amz-data-length", ss.str());
ss.str("");
}
if(m_progressHasBeenSet)
{
ss << m_progress;
headers.emplace("x-amz-progress", ss.str());
ss.str("");
}
if(m_checksumHasBeenSet)
{
ss << m_checksum;
headers.emplace("x-amz-checksum", ss.str());
ss.str("");
}
if(m_checksumAlgorithmHasBeenSet)
{
headers.emplace("x-amz-checksum-algorithm", ChecksumAlgorithmMapper::GetNameForChecksumAlgorithm(m_checksumAlgorithm));
}
return headers;
}

View File

@@ -0,0 +1,50 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/PutSnapshotBlockResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
PutSnapshotBlockResult::PutSnapshotBlockResult() :
m_checksumAlgorithm(ChecksumAlgorithm::NOT_SET)
{
}
PutSnapshotBlockResult::PutSnapshotBlockResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_checksumAlgorithm(ChecksumAlgorithm::NOT_SET)
{
*this = result;
}
PutSnapshotBlockResult& PutSnapshotBlockResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
AWS_UNREFERENCED_PARAM(result);
const auto& headers = result.GetHeaderValueCollection();
const auto& checksumIter = headers.find("x-amz-checksum");
if(checksumIter != headers.end())
{
m_checksum = checksumIter->second;
}
const auto& checksumAlgorithmIter = headers.find("x-amz-checksum-algorithm");
if(checksumAlgorithmIter != headers.end())
{
m_checksumAlgorithm = ChecksumAlgorithmMapper::GetChecksumAlgorithmForName(checksumAlgorithmIter->second);
}
return *this;
}

View File

@@ -0,0 +1,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/RequestThrottledException.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
RequestThrottledException::RequestThrottledException() :
m_messageHasBeenSet(false),
m_reason(RequestThrottledExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
}
RequestThrottledException::RequestThrottledException(JsonView jsonValue) :
m_messageHasBeenSet(false),
m_reason(RequestThrottledExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
*this = jsonValue;
}
RequestThrottledException& RequestThrottledException::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Message"))
{
m_message = jsonValue.GetString("Message");
m_messageHasBeenSet = true;
}
if(jsonValue.ValueExists("Reason"))
{
m_reason = RequestThrottledExceptionReasonMapper::GetRequestThrottledExceptionReasonForName(jsonValue.GetString("Reason"));
m_reasonHasBeenSet = true;
}
return *this;
}
JsonValue RequestThrottledException::Jsonize() const
{
JsonValue payload;
if(m_messageHasBeenSet)
{
payload.WithString("Message", m_message);
}
if(m_reasonHasBeenSet)
{
payload.WithString("Reason", RequestThrottledExceptionReasonMapper::GetNameForRequestThrottledExceptionReason(m_reason));
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/RequestThrottledExceptionReason.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace RequestThrottledExceptionReasonMapper
{
static const int ACCOUNT_THROTTLED_HASH = HashingUtils::HashString("ACCOUNT_THROTTLED");
static const int DEPENDENCY_REQUEST_THROTTLED_HASH = HashingUtils::HashString("DEPENDENCY_REQUEST_THROTTLED");
RequestThrottledExceptionReason GetRequestThrottledExceptionReasonForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == ACCOUNT_THROTTLED_HASH)
{
return RequestThrottledExceptionReason::ACCOUNT_THROTTLED;
}
else if (hashCode == DEPENDENCY_REQUEST_THROTTLED_HASH)
{
return RequestThrottledExceptionReason::DEPENDENCY_REQUEST_THROTTLED;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<RequestThrottledExceptionReason>(hashCode);
}
return RequestThrottledExceptionReason::NOT_SET;
}
Aws::String GetNameForRequestThrottledExceptionReason(RequestThrottledExceptionReason enumValue)
{
switch(enumValue)
{
case RequestThrottledExceptionReason::ACCOUNT_THROTTLED:
return "ACCOUNT_THROTTLED";
case RequestThrottledExceptionReason::DEPENDENCY_REQUEST_THROTTLED:
return "DEPENDENCY_REQUEST_THROTTLED";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace RequestThrottledExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ResourceNotFoundException.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
ResourceNotFoundException::ResourceNotFoundException() :
m_messageHasBeenSet(false),
m_reason(ResourceNotFoundExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
}
ResourceNotFoundException::ResourceNotFoundException(JsonView jsonValue) :
m_messageHasBeenSet(false),
m_reason(ResourceNotFoundExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
*this = jsonValue;
}
ResourceNotFoundException& ResourceNotFoundException::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Message"))
{
m_message = jsonValue.GetString("Message");
m_messageHasBeenSet = true;
}
if(jsonValue.ValueExists("Reason"))
{
m_reason = ResourceNotFoundExceptionReasonMapper::GetResourceNotFoundExceptionReasonForName(jsonValue.GetString("Reason"));
m_reasonHasBeenSet = true;
}
return *this;
}
JsonValue ResourceNotFoundException::Jsonize() const
{
JsonValue payload;
if(m_messageHasBeenSet)
{
payload.WithString("Message", m_message);
}
if(m_reasonHasBeenSet)
{
payload.WithString("Reason", ResourceNotFoundExceptionReasonMapper::GetNameForResourceNotFoundExceptionReason(m_reason));
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ResourceNotFoundExceptionReason.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace ResourceNotFoundExceptionReasonMapper
{
static const int SNAPSHOT_NOT_FOUND_HASH = HashingUtils::HashString("SNAPSHOT_NOT_FOUND");
static const int DEPENDENCY_RESOURCE_NOT_FOUND_HASH = HashingUtils::HashString("DEPENDENCY_RESOURCE_NOT_FOUND");
ResourceNotFoundExceptionReason GetResourceNotFoundExceptionReasonForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == SNAPSHOT_NOT_FOUND_HASH)
{
return ResourceNotFoundExceptionReason::SNAPSHOT_NOT_FOUND;
}
else if (hashCode == DEPENDENCY_RESOURCE_NOT_FOUND_HASH)
{
return ResourceNotFoundExceptionReason::DEPENDENCY_RESOURCE_NOT_FOUND;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ResourceNotFoundExceptionReason>(hashCode);
}
return ResourceNotFoundExceptionReason::NOT_SET;
}
Aws::String GetNameForResourceNotFoundExceptionReason(ResourceNotFoundExceptionReason enumValue)
{
switch(enumValue)
{
case ResourceNotFoundExceptionReason::SNAPSHOT_NOT_FOUND:
return "SNAPSHOT_NOT_FOUND";
case ResourceNotFoundExceptionReason::DEPENDENCY_RESOURCE_NOT_FOUND:
return "DEPENDENCY_RESOURCE_NOT_FOUND";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ResourceNotFoundExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ServiceQuotaExceededException.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
ServiceQuotaExceededException::ServiceQuotaExceededException() :
m_messageHasBeenSet(false),
m_reason(ServiceQuotaExceededExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
}
ServiceQuotaExceededException::ServiceQuotaExceededException(JsonView jsonValue) :
m_messageHasBeenSet(false),
m_reason(ServiceQuotaExceededExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
*this = jsonValue;
}
ServiceQuotaExceededException& ServiceQuotaExceededException::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Message"))
{
m_message = jsonValue.GetString("Message");
m_messageHasBeenSet = true;
}
if(jsonValue.ValueExists("Reason"))
{
m_reason = ServiceQuotaExceededExceptionReasonMapper::GetServiceQuotaExceededExceptionReasonForName(jsonValue.GetString("Reason"));
m_reasonHasBeenSet = true;
}
return *this;
}
JsonValue ServiceQuotaExceededException::Jsonize() const
{
JsonValue payload;
if(m_messageHasBeenSet)
{
payload.WithString("Message", m_message);
}
if(m_reasonHasBeenSet)
{
payload.WithString("Reason", ServiceQuotaExceededExceptionReasonMapper::GetNameForServiceQuotaExceededExceptionReason(m_reason));
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,63 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ServiceQuotaExceededExceptionReason.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace ServiceQuotaExceededExceptionReasonMapper
{
static const int DEPENDENCY_SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("DEPENDENCY_SERVICE_QUOTA_EXCEEDED");
ServiceQuotaExceededExceptionReason GetServiceQuotaExceededExceptionReasonForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == DEPENDENCY_SERVICE_QUOTA_EXCEEDED_HASH)
{
return ServiceQuotaExceededExceptionReason::DEPENDENCY_SERVICE_QUOTA_EXCEEDED;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ServiceQuotaExceededExceptionReason>(hashCode);
}
return ServiceQuotaExceededExceptionReason::NOT_SET;
}
Aws::String GetNameForServiceQuotaExceededExceptionReason(ServiceQuotaExceededExceptionReason enumValue)
{
switch(enumValue)
{
case ServiceQuotaExceededExceptionReason::DEPENDENCY_SERVICE_QUOTA_EXCEEDED:
return "DEPENDENCY_SERVICE_QUOTA_EXCEEDED";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ServiceQuotaExceededExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,93 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/StartSnapshotRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
StartSnapshotRequest::StartSnapshotRequest() :
m_volumeSize(0),
m_volumeSizeHasBeenSet(false),
m_parentSnapshotIdHasBeenSet(false),
m_tagsHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_clientToken(Aws::Utils::UUID::RandomUUID()),
m_clientTokenHasBeenSet(true),
m_encrypted(false),
m_encryptedHasBeenSet(false),
m_kmsKeyArnHasBeenSet(false),
m_timeout(0),
m_timeoutHasBeenSet(false)
{
}
Aws::String StartSnapshotRequest::SerializePayload() const
{
JsonValue payload;
if(m_volumeSizeHasBeenSet)
{
payload.WithInt64("VolumeSize", m_volumeSize);
}
if(m_parentSnapshotIdHasBeenSet)
{
payload.WithString("ParentSnapshotId", m_parentSnapshotId);
}
if(m_tagsHasBeenSet)
{
Array<JsonValue> tagsJsonList(m_tags.size());
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
}
payload.WithArray("Tags", std::move(tagsJsonList));
}
if(m_descriptionHasBeenSet)
{
payload.WithString("Description", m_description);
}
if(m_clientTokenHasBeenSet)
{
payload.WithString("ClientToken", m_clientToken);
}
if(m_encryptedHasBeenSet)
{
payload.WithBool("Encrypted", m_encrypted);
}
if(m_kmsKeyArnHasBeenSet)
{
payload.WithString("KmsKeyArn", m_kmsKeyArn);
}
if(m_timeoutHasBeenSet)
{
payload.WithInteger("Timeout", m_timeout);
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,103 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/StartSnapshotResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::EBS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
StartSnapshotResult::StartSnapshotResult() :
m_status(Status::NOT_SET),
m_volumeSize(0),
m_blockSize(0)
{
}
StartSnapshotResult::StartSnapshotResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_status(Status::NOT_SET),
m_volumeSize(0),
m_blockSize(0)
{
*this = result;
}
StartSnapshotResult& StartSnapshotResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("Description"))
{
m_description = jsonValue.GetString("Description");
}
if(jsonValue.ValueExists("SnapshotId"))
{
m_snapshotId = jsonValue.GetString("SnapshotId");
}
if(jsonValue.ValueExists("OwnerId"))
{
m_ownerId = jsonValue.GetString("OwnerId");
}
if(jsonValue.ValueExists("Status"))
{
m_status = StatusMapper::GetStatusForName(jsonValue.GetString("Status"));
}
if(jsonValue.ValueExists("StartTime"))
{
m_startTime = jsonValue.GetDouble("StartTime");
}
if(jsonValue.ValueExists("VolumeSize"))
{
m_volumeSize = jsonValue.GetInt64("VolumeSize");
}
if(jsonValue.ValueExists("BlockSize"))
{
m_blockSize = jsonValue.GetInteger("BlockSize");
}
if(jsonValue.ValueExists("Tags"))
{
Array<JsonView> tagsJsonList = jsonValue.GetArray("Tags");
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
m_tags.push_back(tagsJsonList[tagsIndex].AsObject());
}
}
if(jsonValue.ValueExists("ParentSnapshotId"))
{
m_parentSnapshotId = jsonValue.GetString("ParentSnapshotId");
}
if(jsonValue.ValueExists("KmsKeyArn"))
{
m_kmsKeyArn = jsonValue.GetString("KmsKeyArn");
}
return *this;
}

View File

@@ -0,0 +1,77 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/Status.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace StatusMapper
{
static const int completed_HASH = HashingUtils::HashString("completed");
static const int pending_HASH = HashingUtils::HashString("pending");
static const int error_HASH = HashingUtils::HashString("error");
Status GetStatusForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == completed_HASH)
{
return Status::completed;
}
else if (hashCode == pending_HASH)
{
return Status::pending;
}
else if (hashCode == error_HASH)
{
return Status::error;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<Status>(hashCode);
}
return Status::NOT_SET;
}
Aws::String GetNameForStatus(Status enumValue)
{
switch(enumValue)
{
case Status::completed:
return "completed";
case Status::pending:
return "pending";
case Status::error:
return "error";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace StatusMapper
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/Tag.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
Tag::Tag() :
m_keyHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
Tag::Tag(JsonView jsonValue) :
m_keyHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
Tag& Tag::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Key"))
{
m_key = jsonValue.GetString("Key");
m_keyHasBeenSet = true;
}
if(jsonValue.ValueExists("Value"))
{
m_value = jsonValue.GetString("Value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue Tag::Jsonize() const
{
JsonValue payload;
if(m_keyHasBeenSet)
{
payload.WithString("Key", m_key);
}
if(m_valueHasBeenSet)
{
payload.WithString("Value", m_value);
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,75 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ValidationException.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
ValidationException::ValidationException() :
m_messageHasBeenSet(false),
m_reason(ValidationExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
}
ValidationException::ValidationException(JsonView jsonValue) :
m_messageHasBeenSet(false),
m_reason(ValidationExceptionReason::NOT_SET),
m_reasonHasBeenSet(false)
{
*this = jsonValue;
}
ValidationException& ValidationException::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Message"))
{
m_message = jsonValue.GetString("Message");
m_messageHasBeenSet = true;
}
if(jsonValue.ValueExists("Reason"))
{
m_reason = ValidationExceptionReasonMapper::GetValidationExceptionReasonForName(jsonValue.GetString("Reason"));
m_reasonHasBeenSet = true;
}
return *this;
}
JsonValue ValidationException::Jsonize() const
{
JsonValue payload;
if(m_messageHasBeenSet)
{
payload.WithString("Message", m_message);
}
if(m_reasonHasBeenSet)
{
payload.WithString("Reason", ValidationExceptionReasonMapper::GetNameForValidationExceptionReason(m_reason));
}
return payload;
}
} // namespace Model
} // namespace EBS
} // namespace Aws

View File

@@ -0,0 +1,133 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ebs/model/ValidationExceptionReason.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace EBS
{
namespace Model
{
namespace ValidationExceptionReasonMapper
{
static const int INVALID_CUSTOMER_KEY_HASH = HashingUtils::HashString("INVALID_CUSTOMER_KEY");
static const int INVALID_PAGE_TOKEN_HASH = HashingUtils::HashString("INVALID_PAGE_TOKEN");
static const int INVALID_BLOCK_TOKEN_HASH = HashingUtils::HashString("INVALID_BLOCK_TOKEN");
static const int INVALID_SNAPSHOT_ID_HASH = HashingUtils::HashString("INVALID_SNAPSHOT_ID");
static const int UNRELATED_SNAPSHOTS_HASH = HashingUtils::HashString("UNRELATED_SNAPSHOTS");
static const int INVALID_BLOCK_HASH = HashingUtils::HashString("INVALID_BLOCK");
static const int INVALID_CONTENT_ENCODING_HASH = HashingUtils::HashString("INVALID_CONTENT_ENCODING");
static const int INVALID_TAG_HASH = HashingUtils::HashString("INVALID_TAG");
static const int INVALID_DEPENDENCY_REQUEST_HASH = HashingUtils::HashString("INVALID_DEPENDENCY_REQUEST");
static const int INVALID_PARAMETER_VALUE_HASH = HashingUtils::HashString("INVALID_PARAMETER_VALUE");
static const int INVALID_VOLUME_SIZE_HASH = HashingUtils::HashString("INVALID_VOLUME_SIZE");
ValidationExceptionReason GetValidationExceptionReasonForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == INVALID_CUSTOMER_KEY_HASH)
{
return ValidationExceptionReason::INVALID_CUSTOMER_KEY;
}
else if (hashCode == INVALID_PAGE_TOKEN_HASH)
{
return ValidationExceptionReason::INVALID_PAGE_TOKEN;
}
else if (hashCode == INVALID_BLOCK_TOKEN_HASH)
{
return ValidationExceptionReason::INVALID_BLOCK_TOKEN;
}
else if (hashCode == INVALID_SNAPSHOT_ID_HASH)
{
return ValidationExceptionReason::INVALID_SNAPSHOT_ID;
}
else if (hashCode == UNRELATED_SNAPSHOTS_HASH)
{
return ValidationExceptionReason::UNRELATED_SNAPSHOTS;
}
else if (hashCode == INVALID_BLOCK_HASH)
{
return ValidationExceptionReason::INVALID_BLOCK;
}
else if (hashCode == INVALID_CONTENT_ENCODING_HASH)
{
return ValidationExceptionReason::INVALID_CONTENT_ENCODING;
}
else if (hashCode == INVALID_TAG_HASH)
{
return ValidationExceptionReason::INVALID_TAG;
}
else if (hashCode == INVALID_DEPENDENCY_REQUEST_HASH)
{
return ValidationExceptionReason::INVALID_DEPENDENCY_REQUEST;
}
else if (hashCode == INVALID_PARAMETER_VALUE_HASH)
{
return ValidationExceptionReason::INVALID_PARAMETER_VALUE;
}
else if (hashCode == INVALID_VOLUME_SIZE_HASH)
{
return ValidationExceptionReason::INVALID_VOLUME_SIZE;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ValidationExceptionReason>(hashCode);
}
return ValidationExceptionReason::NOT_SET;
}
Aws::String GetNameForValidationExceptionReason(ValidationExceptionReason enumValue)
{
switch(enumValue)
{
case ValidationExceptionReason::INVALID_CUSTOMER_KEY:
return "INVALID_CUSTOMER_KEY";
case ValidationExceptionReason::INVALID_PAGE_TOKEN:
return "INVALID_PAGE_TOKEN";
case ValidationExceptionReason::INVALID_BLOCK_TOKEN:
return "INVALID_BLOCK_TOKEN";
case ValidationExceptionReason::INVALID_SNAPSHOT_ID:
return "INVALID_SNAPSHOT_ID";
case ValidationExceptionReason::UNRELATED_SNAPSHOTS:
return "UNRELATED_SNAPSHOTS";
case ValidationExceptionReason::INVALID_BLOCK:
return "INVALID_BLOCK";
case ValidationExceptionReason::INVALID_CONTENT_ENCODING:
return "INVALID_CONTENT_ENCODING";
case ValidationExceptionReason::INVALID_TAG:
return "INVALID_TAG";
case ValidationExceptionReason::INVALID_DEPENDENCY_REQUEST:
return "INVALID_DEPENDENCY_REQUEST";
case ValidationExceptionReason::INVALID_PARAMETER_VALUE:
return "INVALID_PARAMETER_VALUE";
case ValidationExceptionReason::INVALID_VOLUME_SIZE:
return "INVALID_VOLUME_SIZE";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ValidationExceptionReasonMapper
} // namespace Model
} // namespace EBS
} // namespace Aws