Remove unused files from Gems/AWSCore

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-22 15:18:54 -08:00
parent bba337df5e
commit bce3320fb5
9 changed files with 0 additions and 518 deletions
@@ -1,69 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Component/ComponentBus.h>
#include <AzCore/EBus/EBus.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <Framework/AWSApiClientJob.h>
namespace AWSCore
{
/////////////////////////////////////////////
// EBus Definitions
/////////////////////////////////////////////
class HttpClientComponentRequests
: public AZ::ComponentBus
{
public:
virtual ~HttpClientComponentRequests() {}
virtual void MakeHttpRequest(AZStd::string url, AZStd::string method, AZStd::string jsonBody) {}
};
using HttpClientComponentRequestBus = AZ::EBus<HttpClientComponentRequests>;
class HttpClientComponentNotifications
: public AZ::ComponentBus
{
public:
~HttpClientComponentNotifications() override = default;
virtual void OnHttpRequestSuccess(int responseCode, AZStd::string responseBody) {}
virtual void OnHttpRequestFailure(int responseCode) {}
};
using HttpClientComponentNotificationBus = AZ::EBus<HttpClientComponentNotifications>;
/////////////////////////////////////////////
// Entity Component
/////////////////////////////////////////////
class HttpClientComponent
: public AZ::Component
, public HttpClientComponentRequestBus::Handler
{
public:
AZ_COMPONENT(HttpClientComponent, "{23ECDBDF-129A-4670-B9B4-1E0B541ACD61}");
~HttpClientComponent() override = default;
void Init() override;
void Activate() override;
void Deactivate() override;
void MakeHttpRequest(AZStd::string, AZStd::string, AZStd::string) override;
static void Reflect(AZ::ReflectContext*);
};
} // namespace AWSCore
@@ -1,66 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Jobs/JobManager.h>
#include <AzCore/Jobs/JobFunction.h>
#include <aws/core/utils/threading/Executor.h>
namespace AWSCore
{
/// AZ:Job type used by the JobExecuter. It is used call the callback
/// function provided by the AWS SDK.
using ExecuterJob = AZ::JobFunction<std::function<void()>>;
/// This class provides a simple alternative to using the the AwsRequestJob,
/// AwsApiClientJob, or AwsApiJob classes. Those classes provide configuration
/// management and more abstracted usage patterns. With JobExecutor you need
/// to do all the configuration management and work directly with the AWS API.
///
/// An AWS API async executer that uses the AZ::Job system to make AWS service calls.
/// To use, set the Aws::Client::ClientConfiguration executor field so it points to
/// an instance of this class, then use that client configuration object when creating
/// AWS service client objects. This will cause the Async APIs on the AWS service
/// client object to use the AZ::Job system to execute the request.
class JobExecuter
: public Aws::Utils::Threading::Executor
{
public:
/// Initialize a JobExecuter object.
///
/// \param context - The JobContext that will be used to execute the jobs created
/// by the JobExecuter.
///
/// By default the global JobContext is used. However, the AWS SDK currently
/// only supports blocking calls, so, to avoid impacting other jobs, it is
/// recommended that you create a JobContext with a JobManager dedicated to
/// dedicated to processing these jobs. This context can also be used with
/// AwsApiCore::HttpJob.
JobExecuter(AZ::JobContext* context)
: m_context{ context }
{
}
protected:
AZ::JobContext* m_context;
/// Called by the AWS SDK to queue a callback for execution.
bool SubmitToThread(std::function<void()>&& callback) override
{
ExecuterJob* job = aznew ExecuterJob(callback, true, m_context);
job->Start();
}
};
} // namespace AWCore
@@ -1,76 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/std/containers/vector.h>
#include <AzCore/std/string/string.h>
namespace AWSCore
{
/// Class for generating multi-part form data capable of sending files via HTTP POST.
/// The current implementation writes the entire contents of the file to an output buffer in a single operation,
/// i.e. there is no streaming for large files.
/// A stream-based solution would require better bridging of types between CGF and AWS.
class MultipartFormData
{
public:
struct ComposeResult
{
AZStd::string m_content; // Use for the request body
AZStd::string m_contentLength; // Use for the 'Content-Length' HTTP header field
AZStd::string m_contentType; // Use for the 'Content-Type' HTTP header field
};
public:
AZ_CLASS_ALLOCATOR(MultipartFormData, AZ::SystemAllocator, 0);
/// Add a field/value pair to the form
void AddField(AZStd::string name, AZStd::string value);
/// Add a file's contents to the form
void AddFile(AZStd::string fieldName, AZStd::string fileName, const char* path);
void AddFileBytes(AZStd::string fieldName, AZStd::string fileName, const void* bytes, size_t length);
/// Set a custom boundary delimiter to use in the form. This is optional; a random one will be generated normally.
void SetCustomBoundary(AZStd::string boundary);
/// Compose the form's contents and returns those contents along with metadata.
ComposeResult ComposeForm();
private:
struct Field
{
AZStd::string m_fieldName;
AZStd::string m_value;
};
struct FileField
{
AZStd::string m_fieldName;
AZStd::string m_fileName;
AZStd::vector<char> m_fileData;
};
using Fields = AZStd::vector<Field>;
using FileFields = AZStd::vector<FileField>;
private:
void Prepare();
size_t EstimateBodySize() const;
private:
AZStd::string m_boundary;
AZStd::string m_separator;
AZStd::string m_composedBody;
Fields m_fields;
FileFields m_fileFields;
};
} // namespace AWSCore