Open 3D Engine AWSCore Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AWSCore::RequestBuilder Class Reference

#include <RequestBuilder.h>

Public Member Functions

template<class ObjectType >
bool WriteJsonBodyParameter (const ObjectType &bodyObject)
 
bool WriteJsonBodyRaw (const AZStd::string &body)
 
const Aws::String & GetRequestUrl ()
 
void SetRequestUrl (const Aws::String &requestUrl)
 
bool SetPathParameter (const char *key, const AZStd::string &value)
 
bool SetPathParameter (const char *key, const char *value)
 
bool SetPathParameter (const char *key, double value)
 
bool SetPathParameter (const char *key, bool value)
 
bool SetPathParameter (const char *key, int value)
 
bool SetPathParameter (const char *key, int64_t value)
 
bool SetPathParameter (const char *key, unsigned value)
 
bool SetPathParameter (const char *key, uint64_t value)
 
bool AddQueryParameter (const char *name, const AZStd::string &value)
 
bool AddQueryParameter (const char *name, const char *value)
 
bool AddQueryParameter (const char *name, double value)
 
bool AddQueryParameter (const char *name, bool value)
 
bool AddQueryParameter (const char *name, int value)
 
bool AddQueryParameter (const char *name, int64_t value)
 
bool AddQueryParameter (const char *name, unsigned value)
 
bool AddQueryParameter (const char *name, uint64_t value)
 
Aws::Http::HttpMethod GetHttpMethod ()
 
void SetHttpMethod (Aws::Http::HttpMethod httpMethod)
 
const AZStd::string & GetErrorMessage ()
 
void SetErrorMessage (const AZStd::string &message)
 
std::shared_ptr< Aws::StringStream > GetBodyContent ()
 
void SetAWSAuthSigner (std::shared_ptr< Aws::Client::AWSAuthSigner > awsAuthSigner)
 
std::shared_ptr< Aws::Client::AWSAuthSigner > GetAWSAuthSigner ()
 

Detailed Description

Provides methods for replacing url path parameters, appending url query string parameters, and writing body content.

Member Function Documentation

◆ AddQueryParameter()

bool AWSCore::RequestBuilder::AddQueryParameter ( const char *  name,
const AZStd::string &  value 
)

Appends a query parameter to the url. An "?" or "&" is added as needed. The value is escaped.

◆ SetPathParameter()

bool AWSCore::RequestBuilder::SetPathParameter ( const char *  key,
const AZStd::string &  value 
)

Replaces a key with an escaped value. Key should be "{foo}" to replace the "{foo}" part of "/bar/{foo}".

◆ WriteJsonBodyParameter()

template<class ObjectType >
bool AWSCore::RequestBuilder::WriteJsonBodyParameter ( const ObjectType &  bodyObject)
inline

Converts the provided object to JSON and sends it as the body of the request. The object can implement the following function to enable serialization:

bool WriteJson(ServiceApi::JsonWriter& writer) const { bool ok = true; ok = ok && writer.StartObject(); ... ok = ok && writer.EndObject(); return ok; }

Alternatively you can provide a global function with the following signature:

namespace AWSCore { template<> bool GlobalWriteJson<MyObjectType>(ServiceApi::JsonWriter& writer, const MyObjectType& source) { bool ok = true; ... return ok; } }


The documentation for this class was generated from the following file: