mirror of
https://github.com/tribufu/sdk-cpp
synced 2025-06-15 11:14:20 +00:00
Format c++ files on generation
This commit is contained in:
@ -19,37 +19,39 @@
|
|||||||
#ifndef TRIBUFU_MODELS_AnyType_H_
|
#ifndef TRIBUFU_MODELS_AnyType_H_
|
||||||
#define TRIBUFU_MODELS_AnyType_H_
|
#define TRIBUFU_MODELS_AnyType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/Object.h"
|
#include "tribufu++/Object.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
#include <cpprest/json.h>
|
#include <cpprest/json.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
{
|
||||||
|
namespace models
|
||||||
|
{
|
||||||
|
|
||||||
class AnyType : public Object {
|
class AnyType : public Object
|
||||||
public:
|
{
|
||||||
AnyType();
|
public:
|
||||||
virtual ~AnyType();
|
AnyType();
|
||||||
|
virtual ~AnyType();
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// ModelBase overrides
|
/// ModelBase overrides
|
||||||
void validate() override;
|
void validate() override;
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
web::json::value toJson() const override;
|
||||||
bool fromJson(const web::json::value &json) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
const utility::string_t &namePrefix) const override;
|
const utility::string_t &namePrefix) const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
const utility::string_t &namePrefix) override;
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
web::json::value m_value;
|
web::json::value m_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_AnyType_H_ */
|
#endif /* TRIBUFU_MODELS_AnyType_H_ */
|
||||||
|
@ -19,93 +19,87 @@
|
|||||||
#ifndef TRIBUFU_API_ApiClient_H_
|
#ifndef TRIBUFU_API_ApiClient_H_
|
||||||
#define TRIBUFU_API_ApiClient_H_
|
#define TRIBUFU_API_ApiClient_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ApiConfiguration.h"
|
#include "tribufu++/ApiConfiguration.h"
|
||||||
#include "tribufu++/ApiException.h"
|
#include "tribufu++/ApiException.h"
|
||||||
#include "tribufu++/IHttpBody.h"
|
|
||||||
#include "tribufu++/HttpContent.h"
|
#include "tribufu++/HttpContent.h"
|
||||||
|
#include "tribufu++/IHttpBody.h"
|
||||||
|
|
||||||
#if defined (_WIN32) || defined (_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
#undef U
|
#undef U
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
#include <cpprest/http_client.h>
|
#include <cpprest/http_client.h>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace api {
|
|
||||||
|
|
||||||
using namespace tribufu::models;
|
|
||||||
|
|
||||||
class ApiClient
|
|
||||||
{
|
{
|
||||||
public:
|
namespace api
|
||||||
ApiClient( std::shared_ptr<const ApiConfiguration> configuration = nullptr );
|
|
||||||
virtual ~ApiClient();
|
|
||||||
|
|
||||||
typedef std::function<void(web::http::status_code, const web::http::http_headers&)> ResponseHandlerType;
|
|
||||||
|
|
||||||
const ResponseHandlerType& getResponseHandler() const;
|
|
||||||
void setResponseHandler(const ResponseHandlerType& responseHandler);
|
|
||||||
|
|
||||||
std::shared_ptr<const ApiConfiguration> getConfiguration() const;
|
|
||||||
void setConfiguration(std::shared_ptr<const ApiConfiguration> configuration);
|
|
||||||
|
|
||||||
static utility::string_t parameterToString(utility::string_t value);
|
|
||||||
static utility::string_t parameterToString(int32_t value);
|
|
||||||
static utility::string_t parameterToString(int64_t value);
|
|
||||||
static utility::string_t parameterToString(float value);
|
|
||||||
static utility::string_t parameterToString(double value);
|
|
||||||
static utility::string_t parameterToString(const utility::datetime &value);
|
|
||||||
static utility::string_t parameterToString(bool value);
|
|
||||||
template<class T>
|
|
||||||
static utility::string_t parameterToString(const std::vector<T>& value);
|
|
||||||
template<class T>
|
|
||||||
static utility::string_t parameterToString(const std::shared_ptr<T>& value);
|
|
||||||
|
|
||||||
pplx::task<web::http::http_response> callApi(
|
|
||||||
const utility::string_t& path,
|
|
||||||
const utility::string_t& method,
|
|
||||||
const std::map<utility::string_t, utility::string_t>& queryParams,
|
|
||||||
const std::shared_ptr<IHttpBody> postBody,
|
|
||||||
const std::map<utility::string_t, utility::string_t>& headerParams,
|
|
||||||
const std::map<utility::string_t, utility::string_t>& formParams,
|
|
||||||
const std::map<utility::string_t, std::shared_ptr<HttpContent>>& fileParams,
|
|
||||||
const utility::string_t& contentType
|
|
||||||
) const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
ResponseHandlerType m_ResponseHandler;
|
|
||||||
std::shared_ptr<const ApiConfiguration> m_Configuration;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
utility::string_t ApiClient::parameterToString(const std::vector<T>& value)
|
|
||||||
{
|
|
||||||
utility::stringstream_t ss;
|
|
||||||
|
|
||||||
for( size_t i = 0; i < value.size(); i++)
|
|
||||||
{
|
{
|
||||||
if( i > 0) ss << utility::conversions::to_string_t(", ");
|
|
||||||
ss << ApiClient::parameterToString(value[i]);
|
using namespace tribufu::models;
|
||||||
|
|
||||||
|
class ApiClient
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ApiClient(std::shared_ptr<const ApiConfiguration> configuration = nullptr);
|
||||||
|
virtual ~ApiClient();
|
||||||
|
|
||||||
|
typedef std::function<void(web::http::status_code, const web::http::http_headers &)> ResponseHandlerType;
|
||||||
|
|
||||||
|
const ResponseHandlerType &getResponseHandler() const;
|
||||||
|
void setResponseHandler(const ResponseHandlerType &responseHandler);
|
||||||
|
|
||||||
|
std::shared_ptr<const ApiConfiguration> getConfiguration() const;
|
||||||
|
void setConfiguration(std::shared_ptr<const ApiConfiguration> configuration);
|
||||||
|
|
||||||
|
static utility::string_t parameterToString(utility::string_t value);
|
||||||
|
static utility::string_t parameterToString(int32_t value);
|
||||||
|
static utility::string_t parameterToString(int64_t value);
|
||||||
|
static utility::string_t parameterToString(float value);
|
||||||
|
static utility::string_t parameterToString(double value);
|
||||||
|
static utility::string_t parameterToString(const utility::datetime &value);
|
||||||
|
static utility::string_t parameterToString(bool value);
|
||||||
|
template <class T> static utility::string_t parameterToString(const std::vector<T> &value);
|
||||||
|
template <class T> static utility::string_t parameterToString(const std::shared_ptr<T> &value);
|
||||||
|
|
||||||
|
pplx::task<web::http::http_response> callApi(
|
||||||
|
const utility::string_t &path, const utility::string_t &method,
|
||||||
|
const std::map<utility::string_t, utility::string_t> &queryParams,
|
||||||
|
const std::shared_ptr<IHttpBody> postBody,
|
||||||
|
const std::map<utility::string_t, utility::string_t> &headerParams,
|
||||||
|
const std::map<utility::string_t, utility::string_t> &formParams,
|
||||||
|
const std::map<utility::string_t, std::shared_ptr<HttpContent>> &fileParams,
|
||||||
|
const utility::string_t &contentType) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
ResponseHandlerType m_ResponseHandler;
|
||||||
|
std::shared_ptr<const ApiConfiguration> m_Configuration;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T> utility::string_t ApiClient::parameterToString(const std::vector<T> &value)
|
||||||
|
{
|
||||||
|
utility::stringstream_t ss;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < value.size(); i++)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
ss << utility::conversions::to_string_t(", ");
|
||||||
|
ss << ApiClient::parameterToString(value[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T> utility::string_t ApiClient::parameterToString(const std::shared_ptr<T> &value)
|
||||||
|
{
|
||||||
|
return parameterToString(*value.get());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
utility::string_t ApiClient::parameterToString(const std::shared_ptr<T>& value)
|
|
||||||
{
|
|
||||||
return parameterToString(*value.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_API_ApiClient_H_ */
|
#endif /* TRIBUFU_API_ApiClient_H_ */
|
||||||
|
@ -19,45 +19,45 @@
|
|||||||
#ifndef TRIBUFU_API_ApiConfiguration_H_
|
#ifndef TRIBUFU_API_ApiConfiguration_H_
|
||||||
#define TRIBUFU_API_ApiConfiguration_H_
|
#define TRIBUFU_API_ApiConfiguration_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
#include <cpprest/http_client.h>
|
#include <cpprest/http_client.h>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace api {
|
|
||||||
|
|
||||||
class ApiConfiguration
|
|
||||||
{
|
{
|
||||||
public:
|
namespace api
|
||||||
ApiConfiguration();
|
{
|
||||||
virtual ~ApiConfiguration();
|
|
||||||
|
|
||||||
const web::http::client::http_client_config& getHttpConfig() const;
|
class ApiConfiguration
|
||||||
void setHttpConfig( web::http::client::http_client_config& value );
|
{
|
||||||
|
public:
|
||||||
|
ApiConfiguration();
|
||||||
|
virtual ~ApiConfiguration();
|
||||||
|
|
||||||
utility::string_t getBaseUrl() const;
|
const web::http::client::http_client_config &getHttpConfig() const;
|
||||||
void setBaseUrl( const utility::string_t value );
|
void setHttpConfig(web::http::client::http_client_config &value);
|
||||||
|
|
||||||
utility::string_t getUserAgent() const;
|
utility::string_t getBaseUrl() const;
|
||||||
void setUserAgent( const utility::string_t value );
|
void setBaseUrl(const utility::string_t value);
|
||||||
|
|
||||||
std::map<utility::string_t, utility::string_t>& getDefaultHeaders();
|
utility::string_t getUserAgent() const;
|
||||||
const std::map<utility::string_t, utility::string_t>& getDefaultHeaders() const;
|
void setUserAgent(const utility::string_t value);
|
||||||
|
|
||||||
utility::string_t getApiKey( const utility::string_t& prefix) const;
|
std::map<utility::string_t, utility::string_t> &getDefaultHeaders();
|
||||||
void setApiKey( const utility::string_t& prefix, const utility::string_t& apiKey );
|
const std::map<utility::string_t, utility::string_t> &getDefaultHeaders() const;
|
||||||
|
|
||||||
protected:
|
utility::string_t getApiKey(const utility::string_t &prefix) const;
|
||||||
utility::string_t m_BaseUrl;
|
void setApiKey(const utility::string_t &prefix, const utility::string_t &apiKey);
|
||||||
std::map<utility::string_t, utility::string_t> m_DefaultHeaders;
|
|
||||||
std::map<utility::string_t, utility::string_t> m_ApiKeys;
|
|
||||||
web::http::client::http_client_config m_HttpConfig;
|
|
||||||
utility::string_t m_UserAgent;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
protected:
|
||||||
|
utility::string_t m_BaseUrl;
|
||||||
|
std::map<utility::string_t, utility::string_t> m_DefaultHeaders;
|
||||||
|
std::map<utility::string_t, utility::string_t> m_ApiKeys;
|
||||||
|
web::http::client::http_client_config m_HttpConfig;
|
||||||
|
utility::string_t m_UserAgent;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif /* TRIBUFU_API_ApiConfiguration_H_ */
|
#endif /* TRIBUFU_API_ApiConfiguration_H_ */
|
||||||
|
@ -19,39 +19,36 @@
|
|||||||
#ifndef TRIBUFU_API_ApiException_H_
|
#ifndef TRIBUFU_API_ApiException_H_
|
||||||
#define TRIBUFU_API_ApiException_H_
|
#define TRIBUFU_API_ApiException_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
#include <cpprest/http_msg.h>
|
#include <cpprest/http_msg.h>
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace api {
|
|
||||||
|
|
||||||
class ApiException
|
|
||||||
: public web::http::http_exception
|
|
||||||
{
|
{
|
||||||
public:
|
namespace api
|
||||||
ApiException( int errorCode
|
{
|
||||||
, const utility::string_t& message
|
|
||||||
, std::shared_ptr<std::istream> content = nullptr );
|
|
||||||
ApiException( int errorCode
|
|
||||||
, const utility::string_t& message
|
|
||||||
, std::map<utility::string_t, utility::string_t>& headers
|
|
||||||
, std::shared_ptr<std::istream> content = nullptr );
|
|
||||||
virtual ~ApiException();
|
|
||||||
|
|
||||||
std::map<utility::string_t, utility::string_t>& getHeaders();
|
class ApiException : public web::http::http_exception
|
||||||
std::shared_ptr<std::istream> getContent() const;
|
{
|
||||||
|
public:
|
||||||
|
ApiException(int errorCode, const utility::string_t &message,
|
||||||
|
std::shared_ptr<std::istream> content = nullptr);
|
||||||
|
ApiException(int errorCode, const utility::string_t &message,
|
||||||
|
std::map<utility::string_t, utility::string_t> &headers,
|
||||||
|
std::shared_ptr<std::istream> content = nullptr);
|
||||||
|
virtual ~ApiException();
|
||||||
|
|
||||||
protected:
|
std::map<utility::string_t, utility::string_t> &getHeaders();
|
||||||
std::shared_ptr<std::istream> m_Content;
|
std::shared_ptr<std::istream> getContent() const;
|
||||||
std::map<utility::string_t, utility::string_t> m_Headers;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
protected:
|
||||||
|
std::shared_ptr<std::istream> m_Content;
|
||||||
|
std::map<utility::string_t, utility::string_t> m_Headers;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_API_ApiBase_H_ */
|
#endif /* TRIBUFU_API_ApiBase_H_ */
|
||||||
|
@ -19,48 +19,48 @@
|
|||||||
#ifndef TRIBUFU_MODELS_HttpContent_H_
|
#ifndef TRIBUFU_MODELS_HttpContent_H_
|
||||||
#define TRIBUFU_MODELS_HttpContent_H_
|
#define TRIBUFU_MODELS_HttpContent_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class HttpContent
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
HttpContent();
|
{
|
||||||
virtual ~HttpContent();
|
|
||||||
|
|
||||||
virtual utility::string_t getContentDisposition() const;
|
class HttpContent
|
||||||
virtual void setContentDisposition( const utility::string_t& value );
|
{
|
||||||
|
public:
|
||||||
|
HttpContent();
|
||||||
|
virtual ~HttpContent();
|
||||||
|
|
||||||
virtual utility::string_t getName() const;
|
virtual utility::string_t getContentDisposition() const;
|
||||||
virtual void setName( const utility::string_t& value );
|
virtual void setContentDisposition(const utility::string_t &value);
|
||||||
|
|
||||||
virtual utility::string_t getFileName() const;
|
virtual utility::string_t getName() const;
|
||||||
virtual void setFileName( const utility::string_t& value );
|
virtual void setName(const utility::string_t &value);
|
||||||
|
|
||||||
virtual utility::string_t getContentType() const;
|
virtual utility::string_t getFileName() const;
|
||||||
virtual void setContentType( const utility::string_t& value );
|
virtual void setFileName(const utility::string_t &value);
|
||||||
|
|
||||||
virtual std::shared_ptr<std::istream> getData() const;
|
virtual utility::string_t getContentType() const;
|
||||||
virtual void setData( std::shared_ptr<std::istream> value );
|
virtual void setContentType(const utility::string_t &value);
|
||||||
|
|
||||||
virtual void writeTo( std::ostream& stream );
|
virtual std::shared_ptr<std::istream> getData() const;
|
||||||
|
virtual void setData(std::shared_ptr<std::istream> value);
|
||||||
|
|
||||||
protected:
|
virtual void writeTo(std::ostream &stream);
|
||||||
// NOTE: no utility::string_t here because those strings can only contain ascii
|
|
||||||
utility::string_t m_ContentDisposition;
|
|
||||||
utility::string_t m_Name;
|
|
||||||
utility::string_t m_FileName;
|
|
||||||
utility::string_t m_ContentType;
|
|
||||||
std::shared_ptr<std::istream> m_Data;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
protected:
|
||||||
|
// NOTE: no utility::string_t here because those strings can only contain ascii
|
||||||
|
utility::string_t m_ContentDisposition;
|
||||||
|
utility::string_t m_Name;
|
||||||
|
utility::string_t m_FileName;
|
||||||
|
utility::string_t m_ContentType;
|
||||||
|
std::shared_ptr<std::istream> m_Data;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_HttpContent_H_ */
|
#endif /* TRIBUFU_MODELS_HttpContent_H_ */
|
||||||
|
@ -19,21 +19,24 @@
|
|||||||
#ifndef TRIBUFU_MODELS_IHttpBody_H_
|
#ifndef TRIBUFU_MODELS_IHttpBody_H_
|
||||||
#define TRIBUFU_MODELS_IHttpBody_H_
|
#define TRIBUFU_MODELS_IHttpBody_H_
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class IHttpBody
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
virtual ~IHttpBody() { }
|
{
|
||||||
|
|
||||||
virtual void writeTo( std::ostream& stream ) = 0;
|
class IHttpBody
|
||||||
};
|
{
|
||||||
|
public:
|
||||||
|
virtual ~IHttpBody()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
}
|
virtual void writeTo(std::ostream &stream) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_IHttpBody_H_ */
|
#endif /* TRIBUFU_MODELS_IHttpBody_H_ */
|
||||||
|
@ -19,28 +19,28 @@
|
|||||||
#ifndef TRIBUFU_MODELS_JsonBody_H_
|
#ifndef TRIBUFU_MODELS_JsonBody_H_
|
||||||
#define TRIBUFU_MODELS_JsonBody_H_
|
#define TRIBUFU_MODELS_JsonBody_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/IHttpBody.h"
|
#include "tribufu++/IHttpBody.h"
|
||||||
|
|
||||||
#include <cpprest/json.h>
|
#include <cpprest/json.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class JsonBody
|
|
||||||
: public IHttpBody
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
JsonBody( const web::json::value& value );
|
{
|
||||||
virtual ~JsonBody();
|
|
||||||
|
|
||||||
void writeTo( std::ostream& target ) override;
|
class JsonBody : public IHttpBody
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
JsonBody(const web::json::value &value);
|
||||||
|
virtual ~JsonBody();
|
||||||
|
|
||||||
protected:
|
void writeTo(std::ostream &target) override;
|
||||||
web::json::value m_Json;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
protected:
|
||||||
|
web::json::value m_Json;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_JsonBody_H_ */
|
#endif /* TRIBUFU_MODELS_JsonBody_H_ */
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
#ifndef TRIBUFU_MODELS_ModelBase_H_
|
#ifndef TRIBUFU_MODELS_ModelBase_H_
|
||||||
#define TRIBUFU_MODELS_ModelBase_H_
|
#define TRIBUFU_MODELS_ModelBase_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/HttpContent.h"
|
#include "tribufu++/HttpContent.h"
|
||||||
#include "tribufu++/MultipartFormData.h"
|
#include "tribufu++/MultipartFormData.h"
|
||||||
|
|
||||||
@ -31,472 +29,485 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
ModelBase();
|
|
||||||
virtual ~ModelBase();
|
|
||||||
|
|
||||||
virtual void validate() = 0;
|
|
||||||
|
|
||||||
virtual web::json::value toJson() const = 0;
|
|
||||||
virtual bool fromJson( const web::json::value& json ) = 0;
|
|
||||||
|
|
||||||
virtual void toMultipart( std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix ) const = 0;
|
|
||||||
virtual bool fromMultiPart( std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix ) = 0;
|
|
||||||
|
|
||||||
virtual bool isSet() const;
|
|
||||||
|
|
||||||
static utility::string_t toString( const bool val );
|
|
||||||
static utility::string_t toString( const float val );
|
|
||||||
static utility::string_t toString( const double val );
|
|
||||||
static utility::string_t toString( const int32_t val );
|
|
||||||
static utility::string_t toString( const int64_t val );
|
|
||||||
static utility::string_t toString( const utility::string_t &val );
|
|
||||||
static utility::string_t toString( const utility::datetime &val );
|
|
||||||
static utility::string_t toString( const web::json::value &val );
|
|
||||||
static utility::string_t toString( const std::shared_ptr<HttpContent>& val );
|
|
||||||
template <typename T>
|
|
||||||
static utility::string_t toString( const std::shared_ptr<T>& val );
|
|
||||||
template <typename T>
|
|
||||||
static utility::string_t toString( const std::vector<T> & val );
|
|
||||||
template <typename T>
|
|
||||||
static utility::string_t toString( const std::set<T> & val );
|
|
||||||
|
|
||||||
static web::json::value toJson( bool val );
|
|
||||||
static web::json::value toJson( float val );
|
|
||||||
static web::json::value toJson( double val );
|
|
||||||
static web::json::value toJson( int32_t val );
|
|
||||||
static web::json::value toJson( int64_t val );
|
|
||||||
static web::json::value toJson( const utility::string_t& val );
|
|
||||||
static web::json::value toJson( const utility::datetime& val );
|
|
||||||
static web::json::value toJson( const web::json::value& val );
|
|
||||||
static web::json::value toJson( const std::shared_ptr<HttpContent>& val );
|
|
||||||
template<typename T>
|
|
||||||
static web::json::value toJson( const std::shared_ptr<T>& val );
|
|
||||||
static web::json::value toJson( const std::shared_ptr<utility::datetime>& val );
|
|
||||||
template<typename T>
|
|
||||||
static web::json::value toJson( const std::vector<T>& val );
|
|
||||||
template<typename T>
|
|
||||||
static web::json::value toJson( const std::set<T>& val );
|
|
||||||
template<typename T>
|
|
||||||
static web::json::value toJson( const std::map<utility::string_t, T>& val );
|
|
||||||
|
|
||||||
static bool fromString( const utility::string_t& val, bool & );
|
|
||||||
static bool fromString( const utility::string_t& val, float & );
|
|
||||||
static bool fromString( const utility::string_t& val, double & );
|
|
||||||
static bool fromString( const utility::string_t& val, int32_t & );
|
|
||||||
static bool fromString( const utility::string_t& val, int64_t & );
|
|
||||||
static bool fromString( const utility::string_t& val, utility::string_t & );
|
|
||||||
static bool fromString( const utility::string_t& val, utility::datetime & );
|
|
||||||
static bool fromString( const utility::string_t& val, web::json::value & );
|
|
||||||
static bool fromString( const utility::string_t& val, std::shared_ptr<HttpContent> & );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromString( const utility::string_t& val, std::shared_ptr<T>& );
|
|
||||||
static bool fromString( const utility::string_t& val, std::shared_ptr<utility::datetime>& outVal );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromString( const utility::string_t& val, std::vector<T> & );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromString( const utility::string_t& val, std::set<T> & );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromString( const utility::string_t& val, std::map<utility::string_t, T> & );
|
|
||||||
|
|
||||||
static bool fromJson( const web::json::value& val, bool & );
|
|
||||||
static bool fromJson( const web::json::value& val, float & );
|
|
||||||
static bool fromJson( const web::json::value& val, double & );
|
|
||||||
static bool fromJson( const web::json::value& val, int32_t & );
|
|
||||||
static bool fromJson( const web::json::value& val, int64_t & );
|
|
||||||
static bool fromJson( const web::json::value& val, utility::string_t & );
|
|
||||||
static bool fromJson( const web::json::value& val, utility::datetime & );
|
|
||||||
static bool fromJson( const web::json::value& val, web::json::value & );
|
|
||||||
static bool fromJson( const web::json::value& val, std::shared_ptr<HttpContent> & );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromJson( const web::json::value& val, std::shared_ptr<T>& );
|
|
||||||
static bool fromJson( const web::json::value& val, std::shared_ptr<utility::datetime> &outVal );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromJson( const web::json::value& val, std::vector<T> & );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromJson( const web::json::value& val, std::set<T> & );
|
|
||||||
template<typename T>
|
|
||||||
static bool fromJson( const web::json::value& val, std::map<utility::string_t, T> & );
|
|
||||||
|
|
||||||
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, bool value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, float value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType = utility::conversions::to_string_t(""));
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType = utility::conversions::to_string_t(""));
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const web::json::value& value, const utility::string_t& contentType = utility::conversions::to_string_t("application/json") );
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const std::shared_ptr<HttpContent>& );
|
|
||||||
template <typename T>
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const std::shared_ptr<T>& , const utility::string_t& contentType = utility::conversions::to_string_t("application/json") );
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent(const utility::string_t& name, const std::shared_ptr<utility::datetime>& value , const utility::string_t& contentType = utility::conversions::to_string_t("application/json") );
|
|
||||||
template <typename T>
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const std::vector<T>& value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
template <typename T>
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const std::set<T>& value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
template <typename T>
|
|
||||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const std::map<utility::string_t, T>& value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
|
||||||
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, bool & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, float & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, double & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, int64_t & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, int32_t & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, utility::string_t & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, utility::datetime & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, web::json::value & );
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, std::shared_ptr<HttpContent>& );
|
|
||||||
template <typename T>
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, std::shared_ptr<T>& );
|
|
||||||
template <typename T>
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, std::vector<T> & );
|
|
||||||
template <typename T>
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, std::set<T> & );
|
|
||||||
template <typename T>
|
|
||||||
static bool fromHttpContent( std::shared_ptr<HttpContent> val, std::map<utility::string_t, T> & );
|
|
||||||
|
|
||||||
static utility::string_t toBase64( utility::string_t value );
|
|
||||||
static utility::string_t toBase64( std::shared_ptr<std::istream> value );
|
|
||||||
static std::shared_ptr<std::istream> fromBase64( const utility::string_t& encoded );
|
|
||||||
protected:
|
|
||||||
bool m_IsSet;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
utility::string_t ModelBase::toString( const std::shared_ptr<T>& val )
|
|
||||||
{
|
|
||||||
utility::stringstream_t ss;
|
|
||||||
if( val != nullptr )
|
|
||||||
{
|
{
|
||||||
val->toJson().serialize(ss);
|
|
||||||
}
|
|
||||||
return utility::string_t(ss.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
// std::vector to string
|
class ModelBase
|
||||||
template<typename T>
|
|
||||||
utility::string_t ModelBase::toString( const std::vector<T> & val )
|
|
||||||
{
|
|
||||||
utility::string_t strArray;
|
|
||||||
for ( const auto &item : val )
|
|
||||||
{
|
|
||||||
strArray.append( toString(item) + "," );
|
|
||||||
}
|
|
||||||
if (val.count() > 0)
|
|
||||||
{
|
|
||||||
strArray.pop_back();
|
|
||||||
}
|
|
||||||
return strArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
// std::set to string
|
|
||||||
template<typename T>
|
|
||||||
utility::string_t ModelBase::toString( const std::set<T> & val )
|
|
||||||
{
|
|
||||||
utility::string_t strArray;
|
|
||||||
for ( const auto &item : val )
|
|
||||||
{
|
|
||||||
strArray.append( toString(item) + "," );
|
|
||||||
}
|
|
||||||
if (val.count() > 0)
|
|
||||||
{
|
|
||||||
strArray.pop_back();
|
|
||||||
}
|
|
||||||
return strArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
web::json::value ModelBase::toJson( const std::shared_ptr<T>& val )
|
|
||||||
{
|
|
||||||
web::json::value retVal;
|
|
||||||
if(val != nullptr)
|
|
||||||
{
|
|
||||||
retVal = val->toJson();
|
|
||||||
}
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
// std::vector to json
|
|
||||||
template<typename T>
|
|
||||||
web::json::value ModelBase::toJson( const std::vector<T>& value )
|
|
||||||
{
|
|
||||||
std::vector<web::json::value> ret;
|
|
||||||
for ( const auto& x : value )
|
|
||||||
{
|
|
||||||
ret.push_back( toJson(x) );
|
|
||||||
}
|
|
||||||
return web::json::value::array(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
// std::set to json
|
|
||||||
template<typename T>
|
|
||||||
web::json::value ModelBase::toJson( const std::set<T>& value )
|
|
||||||
{
|
|
||||||
// There's no prototype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array.
|
|
||||||
std::vector<web::json::value> ret;
|
|
||||||
for ( const auto& x : value )
|
|
||||||
{
|
|
||||||
ret.push_back( toJson(x) );
|
|
||||||
}
|
|
||||||
return web::json::value::array(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
web::json::value ModelBase::toJson( const std::map<utility::string_t, T>& val )
|
|
||||||
{
|
|
||||||
web::json::value obj;
|
|
||||||
for ( const auto &itemkey : val )
|
|
||||||
{
|
|
||||||
obj[itemkey.first] = toJson( itemkey.second );
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr<T>& outVal )
|
|
||||||
{
|
|
||||||
bool ok = false;
|
|
||||||
if(outVal == nullptr)
|
|
||||||
{
|
|
||||||
outVal = std::make_shared<T>();
|
|
||||||
}
|
|
||||||
if( outVal != nullptr )
|
|
||||||
{
|
|
||||||
ok = outVal->fromJson(web::json::value::parse(val));
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromString(const utility::string_t& val, std::vector<T>& outVal )
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
web::json::value jsonValue = web::json::value::parse(val);
|
|
||||||
if (jsonValue.is_array())
|
|
||||||
{
|
|
||||||
for (const web::json::value& jitem : jsonValue.as_array())
|
|
||||||
{
|
{
|
||||||
T item;
|
public:
|
||||||
ok &= fromJson(jitem, item);
|
ModelBase();
|
||||||
outVal.push_back(item);
|
virtual ~ModelBase();
|
||||||
|
|
||||||
|
virtual void validate() = 0;
|
||||||
|
|
||||||
|
virtual web::json::value toJson() const = 0;
|
||||||
|
virtual bool fromJson(const web::json::value &json) = 0;
|
||||||
|
|
||||||
|
virtual void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const = 0;
|
||||||
|
virtual bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) = 0;
|
||||||
|
|
||||||
|
virtual bool isSet() const;
|
||||||
|
|
||||||
|
static utility::string_t toString(const bool val);
|
||||||
|
static utility::string_t toString(const float val);
|
||||||
|
static utility::string_t toString(const double val);
|
||||||
|
static utility::string_t toString(const int32_t val);
|
||||||
|
static utility::string_t toString(const int64_t val);
|
||||||
|
static utility::string_t toString(const utility::string_t &val);
|
||||||
|
static utility::string_t toString(const utility::datetime &val);
|
||||||
|
static utility::string_t toString(const web::json::value &val);
|
||||||
|
static utility::string_t toString(const std::shared_ptr<HttpContent> &val);
|
||||||
|
template <typename T> static utility::string_t toString(const std::shared_ptr<T> &val);
|
||||||
|
template <typename T> static utility::string_t toString(const std::vector<T> &val);
|
||||||
|
template <typename T> static utility::string_t toString(const std::set<T> &val);
|
||||||
|
|
||||||
|
static web::json::value toJson(bool val);
|
||||||
|
static web::json::value toJson(float val);
|
||||||
|
static web::json::value toJson(double val);
|
||||||
|
static web::json::value toJson(int32_t val);
|
||||||
|
static web::json::value toJson(int64_t val);
|
||||||
|
static web::json::value toJson(const utility::string_t &val);
|
||||||
|
static web::json::value toJson(const utility::datetime &val);
|
||||||
|
static web::json::value toJson(const web::json::value &val);
|
||||||
|
static web::json::value toJson(const std::shared_ptr<HttpContent> &val);
|
||||||
|
template <typename T> static web::json::value toJson(const std::shared_ptr<T> &val);
|
||||||
|
static web::json::value toJson(const std::shared_ptr<utility::datetime> &val);
|
||||||
|
template <typename T> static web::json::value toJson(const std::vector<T> &val);
|
||||||
|
template <typename T> static web::json::value toJson(const std::set<T> &val);
|
||||||
|
template <typename T> static web::json::value toJson(const std::map<utility::string_t, T> &val);
|
||||||
|
|
||||||
|
static bool fromString(const utility::string_t &val, bool &);
|
||||||
|
static bool fromString(const utility::string_t &val, float &);
|
||||||
|
static bool fromString(const utility::string_t &val, double &);
|
||||||
|
static bool fromString(const utility::string_t &val, int32_t &);
|
||||||
|
static bool fromString(const utility::string_t &val, int64_t &);
|
||||||
|
static bool fromString(const utility::string_t &val, utility::string_t &);
|
||||||
|
static bool fromString(const utility::string_t &val, utility::datetime &);
|
||||||
|
static bool fromString(const utility::string_t &val, web::json::value &);
|
||||||
|
static bool fromString(const utility::string_t &val, std::shared_ptr<HttpContent> &);
|
||||||
|
template <typename T> static bool fromString(const utility::string_t &val, std::shared_ptr<T> &);
|
||||||
|
static bool fromString(const utility::string_t &val, std::shared_ptr<utility::datetime> &outVal);
|
||||||
|
template <typename T> static bool fromString(const utility::string_t &val, std::vector<T> &);
|
||||||
|
template <typename T> static bool fromString(const utility::string_t &val, std::set<T> &);
|
||||||
|
template <typename T>
|
||||||
|
static bool fromString(const utility::string_t &val, std::map<utility::string_t, T> &);
|
||||||
|
|
||||||
|
static bool fromJson(const web::json::value &val, bool &);
|
||||||
|
static bool fromJson(const web::json::value &val, float &);
|
||||||
|
static bool fromJson(const web::json::value &val, double &);
|
||||||
|
static bool fromJson(const web::json::value &val, int32_t &);
|
||||||
|
static bool fromJson(const web::json::value &val, int64_t &);
|
||||||
|
static bool fromJson(const web::json::value &val, utility::string_t &);
|
||||||
|
static bool fromJson(const web::json::value &val, utility::datetime &);
|
||||||
|
static bool fromJson(const web::json::value &val, web::json::value &);
|
||||||
|
static bool fromJson(const web::json::value &val, std::shared_ptr<HttpContent> &);
|
||||||
|
template <typename T> static bool fromJson(const web::json::value &val, std::shared_ptr<T> &);
|
||||||
|
static bool fromJson(const web::json::value &val, std::shared_ptr<utility::datetime> &outVal);
|
||||||
|
template <typename T> static bool fromJson(const web::json::value &val, std::vector<T> &);
|
||||||
|
template <typename T> static bool fromJson(const web::json::value &val, std::set<T> &);
|
||||||
|
template <typename T> static bool fromJson(const web::json::value &val, std::map<utility::string_t, T> &);
|
||||||
|
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, bool value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, float value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, double value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, int32_t value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, int64_t value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const utility::string_t &value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const utility::datetime &value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const web::json::value &value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t("application/json"));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(const utility::string_t &name,
|
||||||
|
const std::shared_ptr<HttpContent> &);
|
||||||
|
template <typename T>
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const std::shared_ptr<T> &,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t("application/json"));
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const std::shared_ptr<utility::datetime> &value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t("application/json"));
|
||||||
|
template <typename T>
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const std::vector<T> &value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
template <typename T>
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const std::set<T> &value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
template <typename T>
|
||||||
|
static std::shared_ptr<HttpContent> toHttpContent(
|
||||||
|
const utility::string_t &name, const std::map<utility::string_t, T> &value,
|
||||||
|
const utility::string_t &contentType = utility::conversions::to_string_t(""));
|
||||||
|
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, bool &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, float &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, double &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, int64_t &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, int32_t &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, utility::string_t &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, utility::datetime &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, web::json::value &);
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, std::shared_ptr<HttpContent> &);
|
||||||
|
template <typename T> static bool fromHttpContent(std::shared_ptr<HttpContent> val, std::shared_ptr<T> &);
|
||||||
|
template <typename T> static bool fromHttpContent(std::shared_ptr<HttpContent> val, std::vector<T> &);
|
||||||
|
template <typename T> static bool fromHttpContent(std::shared_ptr<HttpContent> val, std::set<T> &);
|
||||||
|
template <typename T>
|
||||||
|
static bool fromHttpContent(std::shared_ptr<HttpContent> val, std::map<utility::string_t, T> &);
|
||||||
|
|
||||||
|
static utility::string_t toBase64(utility::string_t value);
|
||||||
|
static utility::string_t toBase64(std::shared_ptr<std::istream> value);
|
||||||
|
static std::shared_ptr<std::istream> fromBase64(const utility::string_t &encoded);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_IsSet;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T> utility::string_t ModelBase::toString(const std::shared_ptr<T> &val)
|
||||||
|
{
|
||||||
|
utility::stringstream_t ss;
|
||||||
|
if (val != nullptr)
|
||||||
|
{
|
||||||
|
val->toJson().serialize(ss);
|
||||||
|
}
|
||||||
|
return utility::string_t(ss.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
// std::vector to string
|
||||||
|
template <typename T> utility::string_t ModelBase::toString(const std::vector<T> &val)
|
||||||
|
{
|
||||||
|
utility::string_t strArray;
|
||||||
|
for (const auto &item : val)
|
||||||
|
{
|
||||||
|
strArray.append(toString(item) + ",");
|
||||||
|
}
|
||||||
|
if (val.count() > 0)
|
||||||
|
{
|
||||||
|
strArray.pop_back();
|
||||||
|
}
|
||||||
|
return strArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
// std::set to string
|
||||||
|
template <typename T> utility::string_t ModelBase::toString(const std::set<T> &val)
|
||||||
|
{
|
||||||
|
utility::string_t strArray;
|
||||||
|
for (const auto &item : val)
|
||||||
|
{
|
||||||
|
strArray.append(toString(item) + ",");
|
||||||
|
}
|
||||||
|
if (val.count() > 0)
|
||||||
|
{
|
||||||
|
strArray.pop_back();
|
||||||
|
}
|
||||||
|
return strArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T> web::json::value ModelBase::toJson(const std::shared_ptr<T> &val)
|
||||||
|
{
|
||||||
|
web::json::value retVal;
|
||||||
|
if (val != nullptr)
|
||||||
|
{
|
||||||
|
retVal = val->toJson();
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
// std::vector to json
|
||||||
|
template <typename T> web::json::value ModelBase::toJson(const std::vector<T> &value)
|
||||||
|
{
|
||||||
|
std::vector<web::json::value> ret;
|
||||||
|
for (const auto &x : value)
|
||||||
|
{
|
||||||
|
ret.push_back(toJson(x));
|
||||||
|
}
|
||||||
|
return web::json::value::array(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
// std::set to json
|
||||||
|
template <typename T> web::json::value ModelBase::toJson(const std::set<T> &value)
|
||||||
|
{
|
||||||
|
// There's no prototype web::json::value::array(...) taking a std::set parameter. Converting to std::vector
|
||||||
|
// to get an array.
|
||||||
|
std::vector<web::json::value> ret;
|
||||||
|
for (const auto &x : value)
|
||||||
|
{
|
||||||
|
ret.push_back(toJson(x));
|
||||||
|
}
|
||||||
|
return web::json::value::array(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T> web::json::value ModelBase::toJson(const std::map<utility::string_t, T> &val)
|
||||||
|
{
|
||||||
|
web::json::value obj;
|
||||||
|
for (const auto &itemkey : val)
|
||||||
|
{
|
||||||
|
obj[itemkey.first] = toJson(itemkey.second);
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromString(const utility::string_t &val, std::shared_ptr<T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = false;
|
||||||
|
if (outVal == nullptr)
|
||||||
|
{
|
||||||
|
outVal = std::make_shared<T>();
|
||||||
|
}
|
||||||
|
if (outVal != nullptr)
|
||||||
|
{
|
||||||
|
ok = outVal->fromJson(web::json::value::parse(val));
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromString(const utility::string_t &val, std::vector<T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
web::json::value jsonValue = web::json::value::parse(val);
|
||||||
|
if (jsonValue.is_array())
|
||||||
|
{
|
||||||
|
for (const web::json::value &jitem : jsonValue.as_array())
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok &= fromJson(jitem, item);
|
||||||
|
outVal.push_back(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok = fromJson(jsonValue, item);
|
||||||
|
outVal.push_back(item);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromString(const utility::string_t &val, std::set<T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
web::json::value jsonValue = web::json::value::parse(val);
|
||||||
|
if (jsonValue.is_array())
|
||||||
|
{
|
||||||
|
for (const web::json::value &jitem : jsonValue.as_array())
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok &= fromJson(jitem, item);
|
||||||
|
outVal.insert(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok = fromJson(jsonValue, item);
|
||||||
|
outVal.insert(item);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
bool ModelBase::fromString(const utility::string_t &val, std::map<utility::string_t, T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = false;
|
||||||
|
web::json::value jsonValue = web::json::value::parse(val);
|
||||||
|
if (jsonValue.is_array())
|
||||||
|
{
|
||||||
|
for (const web::json::value &jitem : jsonValue.as_array())
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok &= fromJson(jitem, item);
|
||||||
|
outVal.insert({val, item});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok = fromJson(jsonValue, item);
|
||||||
|
outVal.insert({val, item});
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromJson(const web::json::value &val, std::shared_ptr<T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = false;
|
||||||
|
if (outVal == nullptr)
|
||||||
|
{
|
||||||
|
outVal = std::make_shared<T>();
|
||||||
|
}
|
||||||
|
if (outVal != nullptr)
|
||||||
|
{
|
||||||
|
ok = outVal->fromJson(val);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromJson(const web::json::value &val, std::vector<T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.is_array())
|
||||||
|
{
|
||||||
|
for (const web::json::value &jitem : val.as_array())
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok &= fromJson(jitem, item);
|
||||||
|
outVal.push_back(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromJson(const web::json::value &val, std::set<T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.is_array())
|
||||||
|
{
|
||||||
|
for (const web::json::value &jitem : val.as_array())
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok &= fromJson(jitem, item);
|
||||||
|
outVal.insert(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
T item;
|
||||||
|
ok = fromJson(val, item);
|
||||||
|
outVal.insert(item);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
bool ModelBase::fromJson(const web::json::value &jval, std::map<utility::string_t, T> &outVal)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (jval.is_object())
|
||||||
|
{
|
||||||
|
auto obj = jval.as_object();
|
||||||
|
for (auto objItr = obj.begin(); objItr != obj.end(); objItr++)
|
||||||
|
{
|
||||||
|
T itemVal;
|
||||||
|
ok &= fromJson(objItr->second, itemVal);
|
||||||
|
outVal.insert(std::pair<utility::string_t, T>(objItr->first, itemVal));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
std::shared_ptr<HttpContent> ModelBase::toHttpContent(const utility::string_t &name,
|
||||||
|
const std::shared_ptr<T> &value,
|
||||||
|
const utility::string_t &contentType)
|
||||||
|
{
|
||||||
|
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
||||||
|
if (value != nullptr)
|
||||||
|
{
|
||||||
|
content->setName(name);
|
||||||
|
content->setContentDisposition(utility::conversions::to_string_t("form-data"));
|
||||||
|
content->setContentType(contentType);
|
||||||
|
content->setData(std::make_shared<std::stringstream>(
|
||||||
|
utility::conversions::to_utf8string(value->toJson().serialize())));
|
||||||
|
}
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::shared_ptr<HttpContent> ModelBase::toHttpContent(const utility::string_t &name,
|
||||||
|
const std::vector<T> &value,
|
||||||
|
const utility::string_t &contentType)
|
||||||
|
{
|
||||||
|
web::json::value json_array = ModelBase::toJson(value);
|
||||||
|
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
||||||
|
content->setName(name);
|
||||||
|
content->setContentDisposition(utility::conversions::to_string_t("form-data"));
|
||||||
|
content->setContentType(contentType);
|
||||||
|
content->setData(
|
||||||
|
std::make_shared<std::stringstream>(utility::conversions::to_utf8string(json_array.serialize())));
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
std::shared_ptr<HttpContent> ModelBase::toHttpContent(const utility::string_t &name, const std::set<T> &value,
|
||||||
|
const utility::string_t &contentType)
|
||||||
|
{
|
||||||
|
web::json::value json_array = ModelBase::toJson(value);
|
||||||
|
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
||||||
|
content->setName(name);
|
||||||
|
content->setContentDisposition(utility::conversions::to_string_t("form-data"));
|
||||||
|
content->setContentType(contentType);
|
||||||
|
content->setData(
|
||||||
|
std::make_shared<std::stringstream>(utility::conversions::to_utf8string(json_array.serialize())));
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
std::shared_ptr<HttpContent> ModelBase::toHttpContent(const utility::string_t &name,
|
||||||
|
const std::map<utility::string_t, T> &value,
|
||||||
|
const utility::string_t &contentType)
|
||||||
|
{
|
||||||
|
web::json::value jobj = ModelBase::toJson(value);
|
||||||
|
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
||||||
|
content->setName(name);
|
||||||
|
content->setContentDisposition(utility::conversions::to_string_t("form-data"));
|
||||||
|
content->setContentType(contentType);
|
||||||
|
content->setData(
|
||||||
|
std::make_shared<std::stringstream>(utility::conversions::to_utf8string(jobj.serialize())));
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, std::shared_ptr<T> &outVal)
|
||||||
|
{
|
||||||
|
utility::string_t str;
|
||||||
|
if (val == nullptr)
|
||||||
|
return false;
|
||||||
|
if (outVal == nullptr)
|
||||||
|
{
|
||||||
|
outVal = std::make_shared<T>();
|
||||||
|
}
|
||||||
|
ModelBase::fromHttpContent(val, str);
|
||||||
|
return fromString(str, outVal);
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, std::vector<T> &outVal)
|
||||||
|
{
|
||||||
|
utility::string_t str;
|
||||||
|
if (val == nullptr)
|
||||||
|
return false;
|
||||||
|
ModelBase::fromHttpContent(val, str);
|
||||||
|
return fromString(str, outVal);
|
||||||
|
}
|
||||||
|
template <typename T> bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, std::set<T> &outVal)
|
||||||
|
{
|
||||||
|
utility::string_t str;
|
||||||
|
if (val == nullptr)
|
||||||
|
return false;
|
||||||
|
ModelBase::fromHttpContent(val, str);
|
||||||
|
return fromString(str, outVal);
|
||||||
|
}
|
||||||
|
template <typename T>
|
||||||
|
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, std::map<utility::string_t, T> &outVal)
|
||||||
|
{
|
||||||
|
utility::string_t str;
|
||||||
|
if (val == nullptr)
|
||||||
|
return false;
|
||||||
|
ModelBase::fromHttpContent(val, str);
|
||||||
|
return fromString(str, outVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok = fromJson(jsonValue, item);
|
|
||||||
outVal.push_back(item);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromString(const utility::string_t& val, std::set<T>& outVal )
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
web::json::value jsonValue = web::json::value::parse(val);
|
|
||||||
if (jsonValue.is_array())
|
|
||||||
{
|
|
||||||
for (const web::json::value& jitem : jsonValue.as_array())
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok &= fromJson(jitem, item);
|
|
||||||
outVal.insert(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok = fromJson(jsonValue, item);
|
|
||||||
outVal.insert(item);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromString(const utility::string_t& val, std::map<utility::string_t, T>& outVal )
|
|
||||||
{
|
|
||||||
bool ok = false;
|
|
||||||
web::json::value jsonValue = web::json::value::parse(val);
|
|
||||||
if (jsonValue.is_array())
|
|
||||||
{
|
|
||||||
for (const web::json::value& jitem : jsonValue.as_array())
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok &= fromJson(jitem, item);
|
|
||||||
outVal.insert({ val, item });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok = fromJson(jsonValue, item);
|
|
||||||
outVal.insert({ val, item });
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromJson( const web::json::value& val, std::shared_ptr<T> &outVal )
|
|
||||||
{
|
|
||||||
bool ok = false;
|
|
||||||
if(outVal == nullptr)
|
|
||||||
{
|
|
||||||
outVal = std::make_shared<T>();
|
|
||||||
}
|
|
||||||
if( outVal != nullptr )
|
|
||||||
{
|
|
||||||
ok = outVal->fromJson(val);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromJson( const web::json::value& val, std::vector<T> &outVal )
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if (val.is_array())
|
|
||||||
{
|
|
||||||
for (const web::json::value & jitem : val.as_array())
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok &= fromJson(jitem, item);
|
|
||||||
outVal.push_back(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromJson(const web::json::value& val, std::set<T>& outVal )
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if (val.is_array())
|
|
||||||
{
|
|
||||||
for (const web::json::value& jitem : val.as_array())
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok &= fromJson(jitem, item);
|
|
||||||
outVal.insert(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
T item;
|
|
||||||
ok = fromJson(val, item);
|
|
||||||
outVal.insert(item);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
bool ModelBase::fromJson( const web::json::value& jval, std::map<utility::string_t, T> &outVal )
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if ( jval.is_object() )
|
|
||||||
{
|
|
||||||
auto obj = jval.as_object();
|
|
||||||
for( auto objItr = obj.begin() ; objItr != obj.end() ; objItr++ )
|
|
||||||
{
|
|
||||||
T itemVal;
|
|
||||||
ok &= fromJson(objItr->second, itemVal);
|
|
||||||
outVal.insert(std::pair<utility::string_t, T>(objItr->first, itemVal));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent(const utility::string_t& name, const std::shared_ptr<T>& value , const utility::string_t& contentType )
|
|
||||||
{
|
|
||||||
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
|
||||||
if (value != nullptr )
|
|
||||||
{
|
|
||||||
content->setName( name );
|
|
||||||
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
|
|
||||||
content->setContentType( contentType );
|
|
||||||
content->setData( std::make_shared<std::stringstream>( utility::conversions::to_utf8string(value->toJson().serialize()) ) );
|
|
||||||
}
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const std::vector<T>& value, const utility::string_t& contentType )
|
|
||||||
{
|
|
||||||
web::json::value json_array = ModelBase::toJson(value);
|
|
||||||
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
|
||||||
content->setName( name );
|
|
||||||
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
|
|
||||||
content->setContentType( contentType );
|
|
||||||
content->setData( std::make_shared<std::stringstream>( utility::conversions::to_utf8string(json_array.serialize()) ) );
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const std::set<T>& value, const utility::string_t& contentType )
|
|
||||||
{
|
|
||||||
web::json::value json_array = ModelBase::toJson(value);
|
|
||||||
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
|
||||||
content->setName(name);
|
|
||||||
content->setContentDisposition(utility::conversions::to_string_t("form-data"));
|
|
||||||
content->setContentType(contentType);
|
|
||||||
content->setData( std::make_shared<std::stringstream>( utility::conversions::to_utf8string(json_array.serialize()) ) );
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const std::map<utility::string_t, T>& value, const utility::string_t& contentType )
|
|
||||||
{
|
|
||||||
web::json::value jobj = ModelBase::toJson(value);
|
|
||||||
std::shared_ptr<HttpContent> content = std::make_shared<HttpContent>();
|
|
||||||
content->setName( name );
|
|
||||||
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
|
|
||||||
content->setContentType( contentType );
|
|
||||||
content->setData( std::make_shared<std::stringstream>( utility::conversions::to_utf8string(jobj.serialize()) ) );
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
bool ModelBase::fromHttpContent( std::shared_ptr<HttpContent> val, std::shared_ptr<T>& outVal )
|
|
||||||
{
|
|
||||||
utility::string_t str;
|
|
||||||
if(val == nullptr) return false;
|
|
||||||
if( outVal == nullptr )
|
|
||||||
{
|
|
||||||
outVal = std::make_shared<T>();
|
|
||||||
}
|
|
||||||
ModelBase::fromHttpContent(val, str);
|
|
||||||
return fromString(str, outVal);
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
bool ModelBase::fromHttpContent( std::shared_ptr<HttpContent> val, std::vector<T> & outVal )
|
|
||||||
{
|
|
||||||
utility::string_t str;
|
|
||||||
if (val == nullptr) return false;
|
|
||||||
ModelBase::fromHttpContent(val, str);
|
|
||||||
return fromString(str, outVal);
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, std::set<T>& outVal )
|
|
||||||
{
|
|
||||||
utility::string_t str;
|
|
||||||
if (val == nullptr) return false;
|
|
||||||
ModelBase::fromHttpContent(val, str);
|
|
||||||
return fromString(str, outVal);
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
bool ModelBase::fromHttpContent( std::shared_ptr<HttpContent> val, std::map<utility::string_t, T> & outVal )
|
|
||||||
{
|
|
||||||
utility::string_t str;
|
|
||||||
if (val == nullptr) return false;
|
|
||||||
ModelBase::fromHttpContent(val, str);
|
|
||||||
return fromString(str, outVal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_ModelBase_H_ */
|
#endif /* TRIBUFU_MODELS_ModelBase_H_ */
|
||||||
|
@ -19,40 +19,40 @@
|
|||||||
#ifndef TRIBUFU_MODELS_MultipartFormData_H_
|
#ifndef TRIBUFU_MODELS_MultipartFormData_H_
|
||||||
#define TRIBUFU_MODELS_MultipartFormData_H_
|
#define TRIBUFU_MODELS_MultipartFormData_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/IHttpBody.h"
|
|
||||||
#include "tribufu++/HttpContent.h"
|
#include "tribufu++/HttpContent.h"
|
||||||
|
#include "tribufu++/IHttpBody.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class MultipartFormData
|
|
||||||
: public IHttpBody
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
MultipartFormData();
|
{
|
||||||
MultipartFormData(const utility::string_t& boundary);
|
|
||||||
virtual ~MultipartFormData();
|
|
||||||
|
|
||||||
virtual void add( std::shared_ptr<HttpContent> content );
|
class MultipartFormData : public IHttpBody
|
||||||
virtual utility::string_t getBoundary();
|
{
|
||||||
virtual std::shared_ptr<HttpContent> getContent(const utility::string_t& name) const;
|
public:
|
||||||
virtual bool hasContent(const utility::string_t& name) const;
|
MultipartFormData();
|
||||||
virtual void writeTo( std::ostream& target );
|
MultipartFormData(const utility::string_t &boundary);
|
||||||
|
virtual ~MultipartFormData();
|
||||||
|
|
||||||
protected:
|
virtual void add(std::shared_ptr<HttpContent> content);
|
||||||
std::vector<std::shared_ptr<HttpContent>> m_Contents;
|
virtual utility::string_t getBoundary();
|
||||||
utility::string_t m_Boundary;
|
virtual std::shared_ptr<HttpContent> getContent(const utility::string_t &name) const;
|
||||||
std::map<utility::string_t, std::shared_ptr<HttpContent>> m_ContentLookup;
|
virtual bool hasContent(const utility::string_t &name) const;
|
||||||
};
|
virtual void writeTo(std::ostream &target);
|
||||||
|
|
||||||
}
|
protected:
|
||||||
|
std::vector<std::shared_ptr<HttpContent>> m_Contents;
|
||||||
|
utility::string_t m_Boundary;
|
||||||
|
std::map<utility::string_t, std::shared_ptr<HttpContent>> m_ContentLookup;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_MultipartFormData_H_ */
|
#endif /* TRIBUFU_MODELS_MultipartFormData_H_ */
|
||||||
|
@ -19,41 +19,44 @@
|
|||||||
#ifndef TRIBUFU_MODELS_Object_H_
|
#ifndef TRIBUFU_MODELS_Object_H_
|
||||||
#define TRIBUFU_MODELS_Object_H_
|
#define TRIBUFU_MODELS_Object_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
#include <cpprest/json.h>
|
#include <cpprest/json.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class Object : public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Object();
|
{
|
||||||
virtual ~Object();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Object : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
void validate() override;
|
public:
|
||||||
|
Object();
|
||||||
|
virtual ~Object();
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
/////////////////////////////////////////////
|
||||||
bool fromJson(const web::json::value& json) override;
|
/// ModelBase overrides
|
||||||
|
void validate() override;
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
/// Object manipulation
|
const utility::string_t &namePrefix) const override;
|
||||||
web::json::value getValue(const utility::string_t& key) const;
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
void setValue(const utility::string_t& key, const web::json::value& value);
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
private:
|
/////////////////////////////////////////////
|
||||||
web::json::value m_object;
|
/// Object manipulation
|
||||||
};
|
web::json::value getValue(const utility::string_t &key) const;
|
||||||
|
void setValue(const utility::string_t &key, const web::json::value &value);
|
||||||
|
|
||||||
}
|
private:
|
||||||
|
web::json::value m_object;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Object_H_ */
|
#endif /* TRIBUFU_MODELS_Object_H_ */
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* Account.h
|
* Account.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_Account_H_
|
#ifndef TRIBUFU_MODELS_Account_H_
|
||||||
@ -23,108 +23,104 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/AnyType.h"
|
#include "tribufu++/AnyType.h"
|
||||||
#include "tribufu++/model/LoginProvider.h"
|
#include "tribufu++/model/LoginProvider.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Account
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Account();
|
{
|
||||||
virtual ~Account();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Account : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
Account();
|
||||||
|
virtual ~Account();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// Account members
|
/// Account members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getName() const;
|
||||||
bool idIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetId();
|
void unsetName();
|
||||||
void setId(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
std::shared_ptr<LoginProvider> getProvider() const;
|
||||||
bool nameIsSet() const;
|
bool providerIsSet() const;
|
||||||
void unsetName();
|
void unsetProvider();
|
||||||
void setName(const utility::string_t& value);
|
void setProvider(const std::shared_ptr<LoginProvider> &value);
|
||||||
|
|
||||||
std::shared_ptr<LoginProvider> getProvider() const;
|
utility::string_t getUserId() const;
|
||||||
bool providerIsSet() const;
|
bool userIdIsSet() const;
|
||||||
void unsetProvider();
|
void unsetUser_id();
|
||||||
void setProvider(const std::shared_ptr<LoginProvider>& value);
|
void setUserId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUserId() const;
|
bool isAuthorized() const;
|
||||||
bool userIdIsSet() const;
|
bool authorizedIsSet() const;
|
||||||
void unsetUser_id();
|
void unsetAuthorized();
|
||||||
void setUserId(const utility::string_t& value);
|
void setAuthorized(bool value);
|
||||||
|
|
||||||
bool isAuthorized() const;
|
std::shared_ptr<AnyType> getFields() const;
|
||||||
bool authorizedIsSet() const;
|
bool fieldsIsSet() const;
|
||||||
void unsetAuthorized();
|
void unsetFields();
|
||||||
void setAuthorized(bool value);
|
void setFields(const std::shared_ptr<AnyType> &value);
|
||||||
|
|
||||||
std::shared_ptr<AnyType> getFields() const;
|
utility::datetime getCreated() const;
|
||||||
bool fieldsIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetFields();
|
void unsetCreated();
|
||||||
void setFields(const std::shared_ptr<AnyType>& value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
std::shared_ptr<LoginProvider> m_Provider;
|
||||||
utility::string_t m_Id;
|
bool m_ProviderIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_User_id;
|
||||||
bool m_NameIsSet;
|
bool m_User_idIsSet;
|
||||||
|
|
||||||
std::shared_ptr<LoginProvider> m_Provider;
|
bool m_Authorized;
|
||||||
bool m_ProviderIsSet;
|
bool m_AuthorizedIsSet;
|
||||||
|
|
||||||
utility::string_t m_User_id;
|
std::shared_ptr<AnyType> m_Fields;
|
||||||
bool m_User_idIsSet;
|
bool m_FieldsIsSet;
|
||||||
|
|
||||||
bool m_Authorized;
|
utility::datetime m_Created;
|
||||||
bool m_AuthorizedIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
std::shared_ptr<AnyType> m_Fields;
|
utility::datetime m_Updated;
|
||||||
bool m_FieldsIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Account_H_ */
|
#endif /* TRIBUFU_MODELS_Account_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* Application.h
|
* Application.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_Application_H_
|
#ifndef TRIBUFU_MODELS_Application_H_
|
||||||
@ -23,203 +23,199 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/ApplicationType.h"
|
#include "tribufu++/model/ApplicationType.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Application
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Application();
|
{
|
||||||
virtual ~Application();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Application : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
Application();
|
||||||
|
virtual ~Application();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// Application members
|
/// Application members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getName() const;
|
||||||
bool idIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetId();
|
void unsetName();
|
||||||
void setId(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDescription() const;
|
||||||
bool nameIsSet() const;
|
bool descriptionIsSet() const;
|
||||||
void unsetName();
|
void unsetDescription();
|
||||||
void setName(const utility::string_t& value);
|
void setDescription(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDescription() const;
|
std::shared_ptr<ApplicationType> getType() const;
|
||||||
bool descriptionIsSet() const;
|
bool typeIsSet() const;
|
||||||
void unsetDescription();
|
void unsetType();
|
||||||
void setDescription(const utility::string_t& value);
|
void setType(const std::shared_ptr<ApplicationType> &value);
|
||||||
|
|
||||||
std::shared_ptr<ApplicationType> getType() const;
|
utility::string_t getOrganizationId() const;
|
||||||
bool typeIsSet() const;
|
bool organizationIdIsSet() const;
|
||||||
void unsetType();
|
void unsetOrganization_id();
|
||||||
void setType(const std::shared_ptr<ApplicationType>& value);
|
void setOrganizationId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getOrganizationId() const;
|
utility::string_t getIconUrl() const;
|
||||||
bool organizationIdIsSet() const;
|
bool iconUrlIsSet() const;
|
||||||
void unsetOrganization_id();
|
void unsetIcon_url();
|
||||||
void setOrganizationId(const utility::string_t& value);
|
void setIconUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getIconUrl() const;
|
utility::string_t getBannerUrl() const;
|
||||||
bool iconUrlIsSet() const;
|
bool bannerUrlIsSet() const;
|
||||||
void unsetIcon_url();
|
void unsetBanner_url();
|
||||||
void setIconUrl(const utility::string_t& value);
|
void setBannerUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBannerUrl() const;
|
utility::string_t getCapsuleImageUrl() const;
|
||||||
bool bannerUrlIsSet() const;
|
bool capsuleImageUrlIsSet() const;
|
||||||
void unsetBanner_url();
|
void unsetCapsule_image_url();
|
||||||
void setBannerUrl(const utility::string_t& value);
|
void setCapsuleImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCapsuleImageUrl() const;
|
utility::string_t getLibraryImageUrl() const;
|
||||||
bool capsuleImageUrlIsSet() const;
|
bool libraryImageUrlIsSet() const;
|
||||||
void unsetCapsule_image_url();
|
void unsetLibrary_image_url();
|
||||||
void setCapsuleImageUrl(const utility::string_t& value);
|
void setLibraryImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLibraryImageUrl() const;
|
utility::string_t getParentId() const;
|
||||||
bool libraryImageUrlIsSet() const;
|
bool parentIdIsSet() const;
|
||||||
void unsetLibrary_image_url();
|
void unsetParent_id();
|
||||||
void setLibraryImageUrl(const utility::string_t& value);
|
void setParentId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getParentId() const;
|
utility::string_t getSlug() const;
|
||||||
bool parentIdIsSet() const;
|
bool slugIsSet() const;
|
||||||
void unsetParent_id();
|
void unsetSlug();
|
||||||
void setParentId(const utility::string_t& value);
|
void setSlug(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getSlug() const;
|
int32_t getVisibility() const;
|
||||||
bool slugIsSet() const;
|
bool visibilityIsSet() const;
|
||||||
void unsetSlug();
|
void unsetVisibility();
|
||||||
void setSlug(const utility::string_t& value);
|
void setVisibility(int32_t value);
|
||||||
|
|
||||||
int32_t getVisibility() const;
|
utility::string_t getPassword() const;
|
||||||
bool visibilityIsSet() const;
|
bool passwordIsSet() const;
|
||||||
void unsetVisibility();
|
void unsetPassword();
|
||||||
void setVisibility(int32_t value);
|
void setPassword(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPassword() const;
|
int32_t getPrimary() const;
|
||||||
bool passwordIsSet() const;
|
bool primaryIsSet() const;
|
||||||
void unsetPassword();
|
void unsetPrimary();
|
||||||
void setPassword(const utility::string_t& value);
|
void setPrimary(int32_t value);
|
||||||
|
|
||||||
int32_t getPrimary() const;
|
int32_t getUserCount() const;
|
||||||
bool primaryIsSet() const;
|
bool userCountIsSet() const;
|
||||||
void unsetPrimary();
|
void unsetUser_count();
|
||||||
void setPrimary(int32_t value);
|
void setUserCount(int32_t value);
|
||||||
|
|
||||||
int32_t getUserCount() const;
|
int32_t getAchievementCount() const;
|
||||||
bool userCountIsSet() const;
|
bool achievementCountIsSet() const;
|
||||||
void unsetUser_count();
|
void unsetAchievement_count();
|
||||||
void setUserCount(int32_t value);
|
void setAchievementCount(int32_t value);
|
||||||
|
|
||||||
int32_t getAchievementCount() const;
|
int32_t getBadgeCount() const;
|
||||||
bool achievementCountIsSet() const;
|
bool badgeCountIsSet() const;
|
||||||
void unsetAchievement_count();
|
void unsetBadge_count();
|
||||||
void setAchievementCount(int32_t value);
|
void setBadgeCount(int32_t value);
|
||||||
|
|
||||||
int32_t getBadgeCount() const;
|
int32_t getDownloadCount() const;
|
||||||
bool badgeCountIsSet() const;
|
bool downloadCountIsSet() const;
|
||||||
void unsetBadge_count();
|
void unsetDownload_count();
|
||||||
void setBadgeCount(int32_t value);
|
void setDownloadCount(int32_t value);
|
||||||
|
|
||||||
int32_t getDownloadCount() const;
|
utility::datetime getCreated() const;
|
||||||
bool downloadCountIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetDownload_count();
|
void unsetCreated();
|
||||||
void setDownloadCount(int32_t value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Description;
|
||||||
utility::string_t m_Id;
|
bool m_DescriptionIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
std::shared_ptr<ApplicationType> m_Type;
|
||||||
bool m_NameIsSet;
|
bool m_TypeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Description;
|
utility::string_t m_Organization_id;
|
||||||
bool m_DescriptionIsSet;
|
bool m_Organization_idIsSet;
|
||||||
|
|
||||||
std::shared_ptr<ApplicationType> m_Type;
|
utility::string_t m_Icon_url;
|
||||||
bool m_TypeIsSet;
|
bool m_Icon_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Organization_id;
|
utility::string_t m_Banner_url;
|
||||||
bool m_Organization_idIsSet;
|
bool m_Banner_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Icon_url;
|
utility::string_t m_Capsule_image_url;
|
||||||
bool m_Icon_urlIsSet;
|
bool m_Capsule_image_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Banner_url;
|
utility::string_t m_Library_image_url;
|
||||||
bool m_Banner_urlIsSet;
|
bool m_Library_image_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Capsule_image_url;
|
utility::string_t m_Parent_id;
|
||||||
bool m_Capsule_image_urlIsSet;
|
bool m_Parent_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Library_image_url;
|
utility::string_t m_Slug;
|
||||||
bool m_Library_image_urlIsSet;
|
bool m_SlugIsSet;
|
||||||
|
|
||||||
utility::string_t m_Parent_id;
|
int32_t m_Visibility;
|
||||||
bool m_Parent_idIsSet;
|
bool m_VisibilityIsSet;
|
||||||
|
|
||||||
utility::string_t m_Slug;
|
utility::string_t m_Password;
|
||||||
bool m_SlugIsSet;
|
bool m_PasswordIsSet;
|
||||||
|
|
||||||
int32_t m_Visibility;
|
int32_t m_Primary;
|
||||||
bool m_VisibilityIsSet;
|
bool m_PrimaryIsSet;
|
||||||
|
|
||||||
utility::string_t m_Password;
|
int32_t m_User_count;
|
||||||
bool m_PasswordIsSet;
|
bool m_User_countIsSet;
|
||||||
|
|
||||||
int32_t m_Primary;
|
int32_t m_Achievement_count;
|
||||||
bool m_PrimaryIsSet;
|
bool m_Achievement_countIsSet;
|
||||||
|
|
||||||
int32_t m_User_count;
|
int32_t m_Badge_count;
|
||||||
bool m_User_countIsSet;
|
bool m_Badge_countIsSet;
|
||||||
|
|
||||||
int32_t m_Achievement_count;
|
int32_t m_Download_count;
|
||||||
bool m_Achievement_countIsSet;
|
bool m_Download_countIsSet;
|
||||||
|
|
||||||
int32_t m_Badge_count;
|
utility::datetime m_Created;
|
||||||
bool m_Badge_countIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
int32_t m_Download_count;
|
utility::datetime m_Updated;
|
||||||
bool m_Download_countIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Application_H_ */
|
#endif /* TRIBUFU_MODELS_Application_H_ */
|
||||||
|
@ -13,52 +13,52 @@
|
|||||||
/*
|
/*
|
||||||
* ApplicationType.h
|
* ApplicationType.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_ApplicationType_H_
|
#ifndef TRIBUFU_MODELS_ApplicationType_H_
|
||||||
#define TRIBUFU_MODELS_ApplicationType_H_
|
#define TRIBUFU_MODELS_ApplicationType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class ApplicationType
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
ApplicationType();
|
|
||||||
virtual ~ApplicationType();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eApplicationType
|
|
||||||
{
|
{
|
||||||
ApplicationType_APPLICATION,
|
|
||||||
ApplicationType_GAME,
|
|
||||||
};
|
|
||||||
|
|
||||||
eApplicationType getValue() const;
|
class ApplicationType : public ModelBase
|
||||||
void setValue(eApplicationType const value);
|
{
|
||||||
|
public:
|
||||||
|
ApplicationType();
|
||||||
|
virtual ~ApplicationType();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eApplicationType m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eApplicationType
|
||||||
|
{
|
||||||
|
ApplicationType_APPLICATION,
|
||||||
|
ApplicationType_GAME,
|
||||||
|
};
|
||||||
|
|
||||||
|
eApplicationType getValue() const;
|
||||||
|
void setValue(eApplicationType const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eApplicationType m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_ApplicationType_H_ */
|
#endif /* TRIBUFU_MODELS_ApplicationType_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* AuthorizeRequest.h
|
* AuthorizeRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_AuthorizeRequest_H_
|
#ifndef TRIBUFU_MODELS_AuthorizeRequest_H_
|
||||||
@ -23,100 +23,96 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
#include "tribufu++/model/CodeChallengeMethod.h"
|
||||||
#include "tribufu++/model/ResponseType.h"
|
#include "tribufu++/model/ResponseType.h"
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
#include "tribufu++/model/CodeChallengeMethod.h"
|
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AuthorizeRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
AuthorizeRequest();
|
{
|
||||||
virtual ~AuthorizeRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class AuthorizeRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
AuthorizeRequest();
|
||||||
|
virtual ~AuthorizeRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// AuthorizeRequest members
|
/// AuthorizeRequest members
|
||||||
|
|
||||||
|
std::shared_ptr<ResponseType> getResponseType() const;
|
||||||
|
bool responseTypeIsSet() const;
|
||||||
|
void unsetResponse_type();
|
||||||
|
void setResponseType(const std::shared_ptr<ResponseType> &value);
|
||||||
|
|
||||||
std::shared_ptr<ResponseType> getResponseType() const;
|
utility::string_t getClientId() const;
|
||||||
bool responseTypeIsSet() const;
|
bool clientIdIsSet() const;
|
||||||
void unsetResponse_type();
|
void unsetClient_id();
|
||||||
void setResponseType(const std::shared_ptr<ResponseType>& value);
|
void setClientId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getClientId() const;
|
utility::string_t getCodeChallenge() const;
|
||||||
bool clientIdIsSet() const;
|
bool codeChallengeIsSet() const;
|
||||||
void unsetClient_id();
|
void unsetCode_challenge();
|
||||||
void setClientId(const utility::string_t& value);
|
void setCodeChallenge(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCodeChallenge() const;
|
std::shared_ptr<CodeChallengeMethod> getCodeChallengeMethod() const;
|
||||||
bool codeChallengeIsSet() const;
|
bool codeChallengeMethodIsSet() const;
|
||||||
void unsetCode_challenge();
|
void unsetCode_challenge_method();
|
||||||
void setCodeChallenge(const utility::string_t& value);
|
void setCodeChallengeMethod(const std::shared_ptr<CodeChallengeMethod> &value);
|
||||||
|
|
||||||
std::shared_ptr<CodeChallengeMethod> getCodeChallengeMethod() const;
|
utility::string_t getRedirectUri() const;
|
||||||
bool codeChallengeMethodIsSet() const;
|
bool redirectUriIsSet() const;
|
||||||
void unsetCode_challenge_method();
|
void unsetRedirect_uri();
|
||||||
void setCodeChallengeMethod(const std::shared_ptr<CodeChallengeMethod>& value);
|
void setRedirectUri(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getRedirectUri() const;
|
utility::string_t getScope() const;
|
||||||
bool redirectUriIsSet() const;
|
bool scopeIsSet() const;
|
||||||
void unsetRedirect_uri();
|
void unsetScope();
|
||||||
void setRedirectUri(const utility::string_t& value);
|
void setScope(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getScope() const;
|
utility::string_t getState() const;
|
||||||
bool scopeIsSet() const;
|
bool stateIsSet() const;
|
||||||
void unsetScope();
|
void unsetState();
|
||||||
void setScope(const utility::string_t& value);
|
void setState(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getState() const;
|
protected:
|
||||||
bool stateIsSet() const;
|
std::shared_ptr<ResponseType> m_Response_type;
|
||||||
void unsetState();
|
bool m_Response_typeIsSet;
|
||||||
void setState(const utility::string_t& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Client_id;
|
||||||
|
bool m_Client_idIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Code_challenge;
|
||||||
std::shared_ptr<ResponseType> m_Response_type;
|
bool m_Code_challengeIsSet;
|
||||||
bool m_Response_typeIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Client_id;
|
std::shared_ptr<CodeChallengeMethod> m_Code_challenge_method;
|
||||||
bool m_Client_idIsSet;
|
bool m_Code_challenge_methodIsSet;
|
||||||
|
|
||||||
utility::string_t m_Code_challenge;
|
utility::string_t m_Redirect_uri;
|
||||||
bool m_Code_challengeIsSet;
|
bool m_Redirect_uriIsSet;
|
||||||
|
|
||||||
std::shared_ptr<CodeChallengeMethod> m_Code_challenge_method;
|
utility::string_t m_Scope;
|
||||||
bool m_Code_challenge_methodIsSet;
|
bool m_ScopeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Redirect_uri;
|
utility::string_t m_State;
|
||||||
bool m_Redirect_uriIsSet;
|
bool m_StateIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::string_t m_Scope;
|
}
|
||||||
bool m_ScopeIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_State;
|
|
||||||
bool m_StateIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_AuthorizeRequest_H_ */
|
#endif /* TRIBUFU_MODELS_AuthorizeRequest_H_ */
|
||||||
|
@ -13,52 +13,52 @@
|
|||||||
/*
|
/*
|
||||||
* CodeChallengeMethod.h
|
* CodeChallengeMethod.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_CodeChallengeMethod_H_
|
#ifndef TRIBUFU_MODELS_CodeChallengeMethod_H_
|
||||||
#define TRIBUFU_MODELS_CodeChallengeMethod_H_
|
#define TRIBUFU_MODELS_CodeChallengeMethod_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class CodeChallengeMethod
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
CodeChallengeMethod();
|
|
||||||
virtual ~CodeChallengeMethod();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eCodeChallengeMethod
|
|
||||||
{
|
{
|
||||||
CodeChallengeMethod_PLAIN,
|
|
||||||
CodeChallengeMethod_S256,
|
|
||||||
};
|
|
||||||
|
|
||||||
eCodeChallengeMethod getValue() const;
|
class CodeChallengeMethod : public ModelBase
|
||||||
void setValue(eCodeChallengeMethod const value);
|
{
|
||||||
|
public:
|
||||||
|
CodeChallengeMethod();
|
||||||
|
virtual ~CodeChallengeMethod();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eCodeChallengeMethod m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eCodeChallengeMethod
|
||||||
|
{
|
||||||
|
CodeChallengeMethod_PLAIN,
|
||||||
|
CodeChallengeMethod_S256,
|
||||||
|
};
|
||||||
|
|
||||||
|
eCodeChallengeMethod getValue() const;
|
||||||
|
void setValue(eCodeChallengeMethod const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eCodeChallengeMethod m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_CodeChallengeMethod_H_ */
|
#endif /* TRIBUFU_MODELS_CodeChallengeMethod_H_ */
|
||||||
|
@ -13,67 +13,62 @@
|
|||||||
/*
|
/*
|
||||||
* CryptoViewModel.h
|
* CryptoViewModel.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_CryptoViewModel_H_
|
#ifndef TRIBUFU_MODELS_CryptoViewModel_H_
|
||||||
#define TRIBUFU_MODELS_CryptoViewModel_H_
|
#define TRIBUFU_MODELS_CryptoViewModel_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CryptoViewModel
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
CryptoViewModel();
|
{
|
||||||
virtual ~CryptoViewModel();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class CryptoViewModel : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
CryptoViewModel();
|
||||||
|
virtual ~CryptoViewModel();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// CryptoViewModel members
|
/// CryptoViewModel members
|
||||||
|
|
||||||
|
utility::string_t getEncoded() const;
|
||||||
|
bool encodedIsSet() const;
|
||||||
|
void unsetEncoded();
|
||||||
|
void setEncoded(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getEncoded() const;
|
utility::string_t getDecoded() const;
|
||||||
bool encodedIsSet() const;
|
bool decodedIsSet() const;
|
||||||
void unsetEncoded();
|
void unsetDecoded();
|
||||||
void setEncoded(const utility::string_t& value);
|
void setDecoded(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDecoded() const;
|
protected:
|
||||||
bool decodedIsSet() const;
|
utility::string_t m_Encoded;
|
||||||
void unsetDecoded();
|
bool m_EncodedIsSet;
|
||||||
void setDecoded(const utility::string_t& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Decoded;
|
||||||
|
bool m_DecodedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
}
|
||||||
utility::string_t m_Encoded;
|
|
||||||
bool m_EncodedIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Decoded;
|
|
||||||
bool m_DecodedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_CryptoViewModel_H_ */
|
#endif /* TRIBUFU_MODELS_CryptoViewModel_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* Game.h
|
* Game.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_Game_H_
|
#ifndef TRIBUFU_MODELS_Game_H_
|
||||||
@ -23,291 +23,287 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/ApplicationType.h"
|
#include "tribufu++/model/ApplicationType.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Game
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Game();
|
{
|
||||||
virtual ~Game();
|
|
||||||
|
class Game : public ModelBase
|
||||||
/////////////////////////////////////////////
|
{
|
||||||
/// ModelBase overrides
|
public:
|
||||||
|
Game();
|
||||||
void validate() override;
|
virtual ~Game();
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
/////////////////////////////////////////////
|
||||||
bool fromJson(const web::json::value& json) override;
|
/// ModelBase overrides
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
void validate() override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// Game members
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
int32_t getGamePort() const;
|
const utility::string_t &namePrefix) override;
|
||||||
bool gamePortIsSet() const;
|
|
||||||
void unsetGame_port();
|
/////////////////////////////////////////////
|
||||||
void setGamePort(int32_t value);
|
/// Game members
|
||||||
|
|
||||||
int32_t getQueryPort() const;
|
int32_t getGamePort() const;
|
||||||
bool queryPortIsSet() const;
|
bool gamePortIsSet() const;
|
||||||
void unsetQuery_port();
|
void unsetGame_port();
|
||||||
void setQueryPort(int32_t value);
|
void setGamePort(int32_t value);
|
||||||
|
|
||||||
int32_t getRconPort() const;
|
int32_t getQueryPort() const;
|
||||||
bool rconPortIsSet() const;
|
bool queryPortIsSet() const;
|
||||||
void unsetRcon_port();
|
void unsetQuery_port();
|
||||||
void setRconPort(int32_t value);
|
void setQueryPort(int32_t value);
|
||||||
|
|
||||||
int32_t getServerCount() const;
|
int32_t getRconPort() const;
|
||||||
bool serverCountIsSet() const;
|
bool rconPortIsSet() const;
|
||||||
void unsetServer_count();
|
void unsetRcon_port();
|
||||||
void setServerCount(int32_t value);
|
void setRconPort(int32_t value);
|
||||||
|
|
||||||
int32_t getSteamAppId() const;
|
int32_t getServerCount() const;
|
||||||
bool steamAppIdIsSet() const;
|
bool serverCountIsSet() const;
|
||||||
void unsetSteam_app_id();
|
void unsetServer_count();
|
||||||
void setSteamAppId(int32_t value);
|
void setServerCount(int32_t value);
|
||||||
|
|
||||||
int32_t getSteamServerAppId() const;
|
int32_t getSteamAppId() const;
|
||||||
bool steamServerAppIdIsSet() const;
|
bool steamAppIdIsSet() const;
|
||||||
void unsetSteam_server_app_id();
|
void unsetSteam_app_id();
|
||||||
void setSteamServerAppId(int32_t value);
|
void setSteamAppId(int32_t value);
|
||||||
|
|
||||||
bool isEnableServers() const;
|
int32_t getSteamServerAppId() const;
|
||||||
bool enableServersIsSet() const;
|
bool steamServerAppIdIsSet() const;
|
||||||
void unsetEnable_servers();
|
void unsetSteam_server_app_id();
|
||||||
void setEnableServers(bool value);
|
void setSteamServerAppId(int32_t value);
|
||||||
|
|
||||||
utility::string_t getRustGamedigId() const;
|
bool isEnableServers() const;
|
||||||
bool rustGamedigIdIsSet() const;
|
bool enableServersIsSet() const;
|
||||||
void unsetRust_gamedig_id();
|
void unsetEnable_servers();
|
||||||
void setRustGamedigId(const utility::string_t& value);
|
void setEnableServers(bool value);
|
||||||
|
|
||||||
utility::string_t getNodeGamedigId() const;
|
utility::string_t getRustGamedigId() const;
|
||||||
bool nodeGamedigIdIsSet() const;
|
bool rustGamedigIdIsSet() const;
|
||||||
void unsetNode_gamedig_id();
|
void unsetRust_gamedig_id();
|
||||||
void setNodeGamedigId(const utility::string_t& value);
|
void setRustGamedigId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getServerConnectUrl() const;
|
utility::string_t getNodeGamedigId() const;
|
||||||
bool serverConnectUrlIsSet() const;
|
bool nodeGamedigIdIsSet() const;
|
||||||
void unsetServer_connect_url();
|
void unsetNode_gamedig_id();
|
||||||
void setServerConnectUrl(const utility::string_t& value);
|
void setNodeGamedigId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getServerTags() const;
|
utility::string_t getServerConnectUrl() const;
|
||||||
bool serverTagsIsSet() const;
|
bool serverConnectUrlIsSet() const;
|
||||||
void unsetServer_tags();
|
void unsetServer_connect_url();
|
||||||
void setServerTags(const utility::string_t& value);
|
void setServerConnectUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getServerTags() const;
|
||||||
bool idIsSet() const;
|
bool serverTagsIsSet() const;
|
||||||
void unsetId();
|
void unsetServer_tags();
|
||||||
void setId(const utility::string_t& value);
|
void setServerTags(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getId() const;
|
||||||
bool nameIsSet() const;
|
bool idIsSet() const;
|
||||||
void unsetName();
|
void unsetId();
|
||||||
void setName(const utility::string_t& value);
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDescription() const;
|
utility::string_t getName() const;
|
||||||
bool descriptionIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetDescription();
|
void unsetName();
|
||||||
void setDescription(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
std::shared_ptr<ApplicationType> getType() const;
|
utility::string_t getDescription() const;
|
||||||
bool typeIsSet() const;
|
bool descriptionIsSet() const;
|
||||||
void unsetType();
|
void unsetDescription();
|
||||||
void setType(const std::shared_ptr<ApplicationType>& value);
|
void setDescription(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getOrganizationId() const;
|
std::shared_ptr<ApplicationType> getType() const;
|
||||||
bool organizationIdIsSet() const;
|
bool typeIsSet() const;
|
||||||
void unsetOrganization_id();
|
void unsetType();
|
||||||
void setOrganizationId(const utility::string_t& value);
|
void setType(const std::shared_ptr<ApplicationType> &value);
|
||||||
|
|
||||||
utility::string_t getIconUrl() const;
|
utility::string_t getOrganizationId() const;
|
||||||
bool iconUrlIsSet() const;
|
bool organizationIdIsSet() const;
|
||||||
void unsetIcon_url();
|
void unsetOrganization_id();
|
||||||
void setIconUrl(const utility::string_t& value);
|
void setOrganizationId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBannerUrl() const;
|
utility::string_t getIconUrl() const;
|
||||||
bool bannerUrlIsSet() const;
|
bool iconUrlIsSet() const;
|
||||||
void unsetBanner_url();
|
void unsetIcon_url();
|
||||||
void setBannerUrl(const utility::string_t& value);
|
void setIconUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCapsuleImageUrl() const;
|
utility::string_t getBannerUrl() const;
|
||||||
bool capsuleImageUrlIsSet() const;
|
bool bannerUrlIsSet() const;
|
||||||
void unsetCapsule_image_url();
|
void unsetBanner_url();
|
||||||
void setCapsuleImageUrl(const utility::string_t& value);
|
void setBannerUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLibraryImageUrl() const;
|
utility::string_t getCapsuleImageUrl() const;
|
||||||
bool libraryImageUrlIsSet() const;
|
bool capsuleImageUrlIsSet() const;
|
||||||
void unsetLibrary_image_url();
|
void unsetCapsule_image_url();
|
||||||
void setLibraryImageUrl(const utility::string_t& value);
|
void setCapsuleImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getParentId() const;
|
utility::string_t getLibraryImageUrl() const;
|
||||||
bool parentIdIsSet() const;
|
bool libraryImageUrlIsSet() const;
|
||||||
void unsetParent_id();
|
void unsetLibrary_image_url();
|
||||||
void setParentId(const utility::string_t& value);
|
void setLibraryImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getSlug() const;
|
utility::string_t getParentId() const;
|
||||||
bool slugIsSet() const;
|
bool parentIdIsSet() const;
|
||||||
void unsetSlug();
|
void unsetParent_id();
|
||||||
void setSlug(const utility::string_t& value);
|
void setParentId(const utility::string_t &value);
|
||||||
|
|
||||||
int32_t getVisibility() const;
|
utility::string_t getSlug() const;
|
||||||
bool visibilityIsSet() const;
|
bool slugIsSet() const;
|
||||||
void unsetVisibility();
|
void unsetSlug();
|
||||||
void setVisibility(int32_t value);
|
void setSlug(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPassword() const;
|
int32_t getVisibility() const;
|
||||||
bool passwordIsSet() const;
|
bool visibilityIsSet() const;
|
||||||
void unsetPassword();
|
void unsetVisibility();
|
||||||
void setPassword(const utility::string_t& value);
|
void setVisibility(int32_t value);
|
||||||
|
|
||||||
|
utility::string_t getPassword() const;
|
||||||
|
bool passwordIsSet() const;
|
||||||
|
void unsetPassword();
|
||||||
|
void setPassword(const utility::string_t &value);
|
||||||
|
|
||||||
|
int32_t getPrimary() const;
|
||||||
|
bool primaryIsSet() const;
|
||||||
|
void unsetPrimary();
|
||||||
|
void setPrimary(int32_t value);
|
||||||
|
|
||||||
int32_t getPrimary() const;
|
int32_t getUserCount() const;
|
||||||
bool primaryIsSet() const;
|
bool userCountIsSet() const;
|
||||||
void unsetPrimary();
|
void unsetUser_count();
|
||||||
void setPrimary(int32_t value);
|
void setUserCount(int32_t value);
|
||||||
|
|
||||||
int32_t getUserCount() const;
|
int32_t getAchievementCount() const;
|
||||||
bool userCountIsSet() const;
|
bool achievementCountIsSet() const;
|
||||||
void unsetUser_count();
|
void unsetAchievement_count();
|
||||||
void setUserCount(int32_t value);
|
void setAchievementCount(int32_t value);
|
||||||
|
|
||||||
int32_t getAchievementCount() const;
|
int32_t getBadgeCount() const;
|
||||||
bool achievementCountIsSet() const;
|
bool badgeCountIsSet() const;
|
||||||
void unsetAchievement_count();
|
void unsetBadge_count();
|
||||||
void setAchievementCount(int32_t value);
|
void setBadgeCount(int32_t value);
|
||||||
|
|
||||||
int32_t getBadgeCount() const;
|
int32_t getDownloadCount() const;
|
||||||
bool badgeCountIsSet() const;
|
bool downloadCountIsSet() const;
|
||||||
void unsetBadge_count();
|
void unsetDownload_count();
|
||||||
void setBadgeCount(int32_t value);
|
void setDownloadCount(int32_t value);
|
||||||
|
|
||||||
int32_t getDownloadCount() const;
|
utility::datetime getCreated() const;
|
||||||
bool downloadCountIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetDownload_count();
|
void unsetCreated();
|
||||||
void setDownloadCount(int32_t value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
int32_t m_Game_port;
|
||||||
void unsetUpdated();
|
bool m_Game_portIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
int32_t m_Query_port;
|
||||||
|
bool m_Query_portIsSet;
|
||||||
|
|
||||||
protected:
|
int32_t m_Rcon_port;
|
||||||
int32_t m_Game_port;
|
bool m_Rcon_portIsSet;
|
||||||
bool m_Game_portIsSet;
|
|
||||||
|
|
||||||
int32_t m_Query_port;
|
int32_t m_Server_count;
|
||||||
bool m_Query_portIsSet;
|
bool m_Server_countIsSet;
|
||||||
|
|
||||||
int32_t m_Rcon_port;
|
int32_t m_Steam_app_id;
|
||||||
bool m_Rcon_portIsSet;
|
bool m_Steam_app_idIsSet;
|
||||||
|
|
||||||
int32_t m_Server_count;
|
int32_t m_Steam_server_app_id;
|
||||||
bool m_Server_countIsSet;
|
bool m_Steam_server_app_idIsSet;
|
||||||
|
|
||||||
int32_t m_Steam_app_id;
|
bool m_Enable_servers;
|
||||||
bool m_Steam_app_idIsSet;
|
bool m_Enable_serversIsSet;
|
||||||
|
|
||||||
int32_t m_Steam_server_app_id;
|
utility::string_t m_Rust_gamedig_id;
|
||||||
bool m_Steam_server_app_idIsSet;
|
bool m_Rust_gamedig_idIsSet;
|
||||||
|
|
||||||
bool m_Enable_servers;
|
utility::string_t m_Node_gamedig_id;
|
||||||
bool m_Enable_serversIsSet;
|
bool m_Node_gamedig_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Rust_gamedig_id;
|
utility::string_t m_Server_connect_url;
|
||||||
bool m_Rust_gamedig_idIsSet;
|
bool m_Server_connect_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Node_gamedig_id;
|
utility::string_t m_Server_tags;
|
||||||
bool m_Node_gamedig_idIsSet;
|
bool m_Server_tagsIsSet;
|
||||||
|
|
||||||
utility::string_t m_Server_connect_url;
|
utility::string_t m_Id;
|
||||||
bool m_Server_connect_urlIsSet;
|
bool m_IdIsSet;
|
||||||
|
|
||||||
utility::string_t m_Server_tags;
|
utility::string_t m_Name;
|
||||||
bool m_Server_tagsIsSet;
|
bool m_NameIsSet;
|
||||||
|
|
||||||
utility::string_t m_Id;
|
utility::string_t m_Description;
|
||||||
bool m_IdIsSet;
|
bool m_DescriptionIsSet;
|
||||||
|
|
||||||
utility::string_t m_Name;
|
std::shared_ptr<ApplicationType> m_Type;
|
||||||
bool m_NameIsSet;
|
bool m_TypeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Description;
|
utility::string_t m_Organization_id;
|
||||||
bool m_DescriptionIsSet;
|
bool m_Organization_idIsSet;
|
||||||
|
|
||||||
std::shared_ptr<ApplicationType> m_Type;
|
utility::string_t m_Icon_url;
|
||||||
bool m_TypeIsSet;
|
bool m_Icon_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Organization_id;
|
utility::string_t m_Banner_url;
|
||||||
bool m_Organization_idIsSet;
|
bool m_Banner_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Icon_url;
|
utility::string_t m_Capsule_image_url;
|
||||||
bool m_Icon_urlIsSet;
|
bool m_Capsule_image_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Banner_url;
|
utility::string_t m_Library_image_url;
|
||||||
bool m_Banner_urlIsSet;
|
bool m_Library_image_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Capsule_image_url;
|
utility::string_t m_Parent_id;
|
||||||
bool m_Capsule_image_urlIsSet;
|
bool m_Parent_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Library_image_url;
|
utility::string_t m_Slug;
|
||||||
bool m_Library_image_urlIsSet;
|
bool m_SlugIsSet;
|
||||||
|
|
||||||
utility::string_t m_Parent_id;
|
int32_t m_Visibility;
|
||||||
bool m_Parent_idIsSet;
|
bool m_VisibilityIsSet;
|
||||||
|
|
||||||
utility::string_t m_Slug;
|
utility::string_t m_Password;
|
||||||
bool m_SlugIsSet;
|
bool m_PasswordIsSet;
|
||||||
|
|
||||||
int32_t m_Visibility;
|
int32_t m_Primary;
|
||||||
bool m_VisibilityIsSet;
|
bool m_PrimaryIsSet;
|
||||||
|
|
||||||
utility::string_t m_Password;
|
int32_t m_User_count;
|
||||||
bool m_PasswordIsSet;
|
bool m_User_countIsSet;
|
||||||
|
|
||||||
int32_t m_Primary;
|
int32_t m_Achievement_count;
|
||||||
bool m_PrimaryIsSet;
|
bool m_Achievement_countIsSet;
|
||||||
|
|
||||||
int32_t m_User_count;
|
int32_t m_Badge_count;
|
||||||
bool m_User_countIsSet;
|
bool m_Badge_countIsSet;
|
||||||
|
|
||||||
int32_t m_Achievement_count;
|
int32_t m_Download_count;
|
||||||
bool m_Achievement_countIsSet;
|
bool m_Download_countIsSet;
|
||||||
|
|
||||||
int32_t m_Badge_count;
|
utility::datetime m_Created;
|
||||||
bool m_Badge_countIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
int32_t m_Download_count;
|
utility::datetime m_Updated;
|
||||||
bool m_Download_countIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Game_H_ */
|
#endif /* TRIBUFU_MODELS_Game_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* GameServer.h
|
* GameServer.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_GameServer_H_
|
#ifndef TRIBUFU_MODELS_GameServer_H_
|
||||||
@ -23,291 +23,287 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/ServerStatus.h"
|
#include "tribufu++/model/ServerStatus.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class GameServer
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
GameServer();
|
{
|
||||||
virtual ~GameServer();
|
|
||||||
|
class GameServer : public ModelBase
|
||||||
/////////////////////////////////////////////
|
{
|
||||||
/// ModelBase overrides
|
public:
|
||||||
|
GameServer();
|
||||||
void validate() override;
|
virtual ~GameServer();
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
/////////////////////////////////////////////
|
||||||
bool fromJson(const web::json::value& json) override;
|
/// ModelBase overrides
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
void validate() override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// GameServer members
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
utility::string_t getId() const;
|
const utility::string_t &namePrefix) override;
|
||||||
bool idIsSet() const;
|
|
||||||
void unsetId();
|
/////////////////////////////////////////////
|
||||||
void setId(const utility::string_t& value);
|
/// GameServer members
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getId() const;
|
||||||
bool nameIsSet() const;
|
bool idIsSet() const;
|
||||||
void unsetName();
|
void unsetId();
|
||||||
void setName(const utility::string_t& value);
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDescription() const;
|
utility::string_t getName() const;
|
||||||
bool descriptionIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetDescription();
|
void unsetName();
|
||||||
void setDescription(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getAddress() const;
|
utility::string_t getDescription() const;
|
||||||
bool addressIsSet() const;
|
bool descriptionIsSet() const;
|
||||||
void unsetAddress();
|
void unsetDescription();
|
||||||
void setAddress(const utility::string_t& value);
|
void setDescription(const utility::string_t &value);
|
||||||
|
|
||||||
int32_t getGamePort() const;
|
utility::string_t getAddress() const;
|
||||||
bool gamePortIsSet() const;
|
bool addressIsSet() const;
|
||||||
void unsetGame_port();
|
void unsetAddress();
|
||||||
void setGamePort(int32_t value);
|
void setAddress(const utility::string_t &value);
|
||||||
|
|
||||||
int32_t getQueryPort() const;
|
int32_t getGamePort() const;
|
||||||
bool queryPortIsSet() const;
|
bool gamePortIsSet() const;
|
||||||
void unsetQuery_port();
|
void unsetGame_port();
|
||||||
void setQueryPort(int32_t value);
|
void setGamePort(int32_t value);
|
||||||
|
|
||||||
utility::string_t getGameId() const;
|
int32_t getQueryPort() const;
|
||||||
bool gameIdIsSet() const;
|
bool queryPortIsSet() const;
|
||||||
void unsetGame_id();
|
void unsetQuery_port();
|
||||||
void setGameId(const utility::string_t& value);
|
void setQueryPort(int32_t value);
|
||||||
|
|
||||||
utility::string_t getGameIconUrl() const;
|
utility::string_t getGameId() const;
|
||||||
bool gameIconUrlIsSet() const;
|
bool gameIdIsSet() const;
|
||||||
void unsetGame_icon_url();
|
void unsetGame_id();
|
||||||
void setGameIconUrl(const utility::string_t& value);
|
void setGameId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getVersion() const;
|
utility::string_t getGameIconUrl() const;
|
||||||
bool versionIsSet() const;
|
bool gameIconUrlIsSet() const;
|
||||||
void unsetVersion();
|
void unsetGame_icon_url();
|
||||||
void setVersion(const utility::string_t& value);
|
void setGameIconUrl(const utility::string_t &value);
|
||||||
|
|
||||||
bool isFeatured() const;
|
utility::string_t getVersion() const;
|
||||||
bool featuredIsSet() const;
|
bool versionIsSet() const;
|
||||||
void unsetFeatured();
|
void unsetVersion();
|
||||||
void setFeatured(bool value);
|
void setVersion(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getClusterId() const;
|
bool isFeatured() const;
|
||||||
bool clusterIdIsSet() const;
|
bool featuredIsSet() const;
|
||||||
void unsetCluster_id();
|
void unsetFeatured();
|
||||||
void setClusterId(const utility::string_t& value);
|
void setFeatured(bool value);
|
||||||
|
|
||||||
utility::string_t getWebsiteUrl() const;
|
utility::string_t getClusterId() const;
|
||||||
bool websiteUrlIsSet() const;
|
bool clusterIdIsSet() const;
|
||||||
void unsetWebsite_url();
|
void unsetCluster_id();
|
||||||
void setWebsiteUrl(const utility::string_t& value);
|
void setClusterId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBannerUrl() const;
|
utility::string_t getWebsiteUrl() const;
|
||||||
bool bannerUrlIsSet() const;
|
bool websiteUrlIsSet() const;
|
||||||
void unsetBanner_url();
|
void unsetWebsite_url();
|
||||||
void setBannerUrl(const utility::string_t& value);
|
void setWebsiteUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getOwnerId() const;
|
utility::string_t getBannerUrl() const;
|
||||||
bool ownerIdIsSet() const;
|
bool bannerUrlIsSet() const;
|
||||||
void unsetOwner_id();
|
void unsetBanner_url();
|
||||||
void setOwnerId(const utility::string_t& value);
|
void setBannerUrl(const utility::string_t &value);
|
||||||
|
|
||||||
double getUptime() const;
|
utility::string_t getOwnerId() const;
|
||||||
bool uptimeIsSet() const;
|
bool ownerIdIsSet() const;
|
||||||
void unsetUptime();
|
void unsetOwner_id();
|
||||||
void setUptime(double value);
|
void setOwnerId(const utility::string_t &value);
|
||||||
|
|
||||||
std::shared_ptr<ServerStatus> getStatus() const;
|
double getUptime() const;
|
||||||
bool statusIsSet() const;
|
bool uptimeIsSet() const;
|
||||||
void unsetStatus();
|
void unsetUptime();
|
||||||
void setStatus(const std::shared_ptr<ServerStatus>& value);
|
void setUptime(double value);
|
||||||
|
|
||||||
int32_t getPing() const;
|
std::shared_ptr<ServerStatus> getStatus() const;
|
||||||
bool pingIsSet() const;
|
bool statusIsSet() const;
|
||||||
void unsetPing();
|
void unsetStatus();
|
||||||
void setPing(int32_t value);
|
void setStatus(const std::shared_ptr<ServerStatus> &value);
|
||||||
|
|
||||||
utility::string_t getMap() const;
|
int32_t getPing() const;
|
||||||
bool mapIsSet() const;
|
bool pingIsSet() const;
|
||||||
void unsetmap();
|
void unsetPing();
|
||||||
void setMap(const utility::string_t& value);
|
void setPing(int32_t value);
|
||||||
|
|
||||||
int32_t getUsedSlots() const;
|
utility::string_t getMap() const;
|
||||||
bool usedSlotsIsSet() const;
|
bool mapIsSet() const;
|
||||||
void unsetUsed_slots();
|
void unsetmap();
|
||||||
void setUsedSlots(int32_t value);
|
void setMap(const utility::string_t &value);
|
||||||
|
|
||||||
int32_t getMaxSlots() const;
|
int32_t getUsedSlots() const;
|
||||||
bool maxSlotsIsSet() const;
|
bool usedSlotsIsSet() const;
|
||||||
void unsetMax_slots();
|
void unsetUsed_slots();
|
||||||
void setMaxSlots(int32_t value);
|
void setUsedSlots(int32_t value);
|
||||||
|
|
||||||
utility::string_t getMotd() const;
|
int32_t getMaxSlots() const;
|
||||||
bool motdIsSet() const;
|
bool maxSlotsIsSet() const;
|
||||||
void unsetMotd();
|
void unsetMax_slots();
|
||||||
void setMotd(const utility::string_t& value);
|
void setMaxSlots(int32_t value);
|
||||||
|
|
||||||
utility::string_t getPlayers() const;
|
utility::string_t getMotd() const;
|
||||||
bool playersIsSet() const;
|
bool motdIsSet() const;
|
||||||
void unsetPlayers();
|
void unsetMotd();
|
||||||
void setPlayers(const utility::string_t& value);
|
void setMotd(const utility::string_t &value);
|
||||||
|
|
||||||
utility::datetime getLastOnline() const;
|
utility::string_t getPlayers() const;
|
||||||
bool lastOnlineIsSet() const;
|
bool playersIsSet() const;
|
||||||
void unsetLast_online();
|
void unsetPlayers();
|
||||||
void setLastOnline(const utility::datetime& value);
|
void setPlayers(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCountry() const;
|
utility::datetime getLastOnline() const;
|
||||||
bool countryIsSet() const;
|
bool lastOnlineIsSet() const;
|
||||||
void unsetCountry();
|
void unsetLast_online();
|
||||||
void setCountry(const utility::string_t& value);
|
void setLastOnline(const utility::datetime &value);
|
||||||
|
|
||||||
|
utility::string_t getCountry() const;
|
||||||
|
bool countryIsSet() const;
|
||||||
|
void unsetCountry();
|
||||||
|
void setCountry(const utility::string_t &value);
|
||||||
|
|
||||||
|
bool isSteam() const;
|
||||||
|
bool steamIsSet() const;
|
||||||
|
void unsetSteam();
|
||||||
|
void setSteam(bool value);
|
||||||
|
|
||||||
bool isSteam() const;
|
utility::string_t getDiscordServerId() const;
|
||||||
bool steamIsSet() const;
|
bool discordServerIdIsSet() const;
|
||||||
void unsetSteam();
|
void unsetDiscord_server_id();
|
||||||
void setSteam(bool value);
|
void setDiscordServerId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDiscordServerId() const;
|
utility::string_t getYoutubeVideoUrl() const;
|
||||||
bool discordServerIdIsSet() const;
|
bool youtubeVideoUrlIsSet() const;
|
||||||
void unsetDiscord_server_id();
|
void unsetYoutube_video_url();
|
||||||
void setDiscordServerId(const utility::string_t& value);
|
void setYoutubeVideoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getYoutubeVideoUrl() const;
|
utility::string_t getTags() const;
|
||||||
bool youtubeVideoUrlIsSet() const;
|
bool tagsIsSet() const;
|
||||||
void unsetYoutube_video_url();
|
void unsetTags();
|
||||||
void setYoutubeVideoUrl(const utility::string_t& value);
|
void setTags(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getTags() const;
|
int32_t getCommentCount() const;
|
||||||
bool tagsIsSet() const;
|
bool commentCountIsSet() const;
|
||||||
void unsetTags();
|
void unsetComment_count();
|
||||||
void setTags(const utility::string_t& value);
|
void setCommentCount(int32_t value);
|
||||||
|
|
||||||
int32_t getCommentCount() const;
|
utility::datetime getCreated() const;
|
||||||
bool commentCountIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetComment_count();
|
void unsetCreated();
|
||||||
void setCommentCount(int32_t value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Description;
|
||||||
utility::string_t m_Id;
|
bool m_DescriptionIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Address;
|
||||||
bool m_NameIsSet;
|
bool m_AddressIsSet;
|
||||||
|
|
||||||
utility::string_t m_Description;
|
int32_t m_Game_port;
|
||||||
bool m_DescriptionIsSet;
|
bool m_Game_portIsSet;
|
||||||
|
|
||||||
utility::string_t m_Address;
|
int32_t m_Query_port;
|
||||||
bool m_AddressIsSet;
|
bool m_Query_portIsSet;
|
||||||
|
|
||||||
int32_t m_Game_port;
|
utility::string_t m_Game_id;
|
||||||
bool m_Game_portIsSet;
|
bool m_Game_idIsSet;
|
||||||
|
|
||||||
int32_t m_Query_port;
|
utility::string_t m_Game_icon_url;
|
||||||
bool m_Query_portIsSet;
|
bool m_Game_icon_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Game_id;
|
utility::string_t m_Version;
|
||||||
bool m_Game_idIsSet;
|
bool m_VersionIsSet;
|
||||||
|
|
||||||
utility::string_t m_Game_icon_url;
|
bool m_Featured;
|
||||||
bool m_Game_icon_urlIsSet;
|
bool m_FeaturedIsSet;
|
||||||
|
|
||||||
utility::string_t m_Version;
|
utility::string_t m_Cluster_id;
|
||||||
bool m_VersionIsSet;
|
bool m_Cluster_idIsSet;
|
||||||
|
|
||||||
bool m_Featured;
|
utility::string_t m_Website_url;
|
||||||
bool m_FeaturedIsSet;
|
bool m_Website_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Cluster_id;
|
utility::string_t m_Banner_url;
|
||||||
bool m_Cluster_idIsSet;
|
bool m_Banner_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Website_url;
|
utility::string_t m_Owner_id;
|
||||||
bool m_Website_urlIsSet;
|
bool m_Owner_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Banner_url;
|
double m_Uptime;
|
||||||
bool m_Banner_urlIsSet;
|
bool m_UptimeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Owner_id;
|
std::shared_ptr<ServerStatus> m_Status;
|
||||||
bool m_Owner_idIsSet;
|
bool m_StatusIsSet;
|
||||||
|
|
||||||
double m_Uptime;
|
int32_t m_Ping;
|
||||||
bool m_UptimeIsSet;
|
bool m_PingIsSet;
|
||||||
|
|
||||||
std::shared_ptr<ServerStatus> m_Status;
|
utility::string_t m_map;
|
||||||
bool m_StatusIsSet;
|
bool m_mapIsSet;
|
||||||
|
|
||||||
int32_t m_Ping;
|
int32_t m_Used_slots;
|
||||||
bool m_PingIsSet;
|
bool m_Used_slotsIsSet;
|
||||||
|
|
||||||
utility::string_t m_map;
|
int32_t m_Max_slots;
|
||||||
bool m_mapIsSet;
|
bool m_Max_slotsIsSet;
|
||||||
|
|
||||||
int32_t m_Used_slots;
|
utility::string_t m_Motd;
|
||||||
bool m_Used_slotsIsSet;
|
bool m_MotdIsSet;
|
||||||
|
|
||||||
int32_t m_Max_slots;
|
utility::string_t m_Players;
|
||||||
bool m_Max_slotsIsSet;
|
bool m_PlayersIsSet;
|
||||||
|
|
||||||
utility::string_t m_Motd;
|
utility::datetime m_Last_online;
|
||||||
bool m_MotdIsSet;
|
bool m_Last_onlineIsSet;
|
||||||
|
|
||||||
utility::string_t m_Players;
|
utility::string_t m_Country;
|
||||||
bool m_PlayersIsSet;
|
bool m_CountryIsSet;
|
||||||
|
|
||||||
utility::datetime m_Last_online;
|
bool m_Steam;
|
||||||
bool m_Last_onlineIsSet;
|
bool m_SteamIsSet;
|
||||||
|
|
||||||
utility::string_t m_Country;
|
utility::string_t m_Discord_server_id;
|
||||||
bool m_CountryIsSet;
|
bool m_Discord_server_idIsSet;
|
||||||
|
|
||||||
bool m_Steam;
|
utility::string_t m_Youtube_video_url;
|
||||||
bool m_SteamIsSet;
|
bool m_Youtube_video_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Discord_server_id;
|
utility::string_t m_Tags;
|
||||||
bool m_Discord_server_idIsSet;
|
bool m_TagsIsSet;
|
||||||
|
|
||||||
utility::string_t m_Youtube_video_url;
|
int32_t m_Comment_count;
|
||||||
bool m_Youtube_video_urlIsSet;
|
bool m_Comment_countIsSet;
|
||||||
|
|
||||||
utility::string_t m_Tags;
|
utility::datetime m_Created;
|
||||||
bool m_TagsIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
int32_t m_Comment_count;
|
utility::datetime m_Updated;
|
||||||
bool m_Comment_countIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_GameServer_H_ */
|
#endif /* TRIBUFU_MODELS_GameServer_H_ */
|
||||||
|
@ -13,163 +13,158 @@
|
|||||||
/*
|
/*
|
||||||
* GameServerCluster.h
|
* GameServerCluster.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_GameServerCluster_H_
|
#ifndef TRIBUFU_MODELS_GameServerCluster_H_
|
||||||
#define TRIBUFU_MODELS_GameServerCluster_H_
|
#define TRIBUFU_MODELS_GameServerCluster_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class GameServerCluster
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
GameServerCluster();
|
{
|
||||||
virtual ~GameServerCluster();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class GameServerCluster : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
GameServerCluster();
|
||||||
|
virtual ~GameServerCluster();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// GameServerCluster members
|
/// GameServerCluster members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getName() const;
|
||||||
bool idIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetId();
|
void unsetName();
|
||||||
void setId(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDescription() const;
|
||||||
bool nameIsSet() const;
|
bool descriptionIsSet() const;
|
||||||
void unsetName();
|
void unsetDescription();
|
||||||
void setName(const utility::string_t& value);
|
void setDescription(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDescription() const;
|
utility::string_t getGameId() const;
|
||||||
bool descriptionIsSet() const;
|
bool gameIdIsSet() const;
|
||||||
void unsetDescription();
|
void unsetGame_id();
|
||||||
void setDescription(const utility::string_t& value);
|
void setGameId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getGameId() const;
|
utility::string_t getWebsiteUrl() const;
|
||||||
bool gameIdIsSet() const;
|
bool websiteUrlIsSet() const;
|
||||||
void unsetGame_id();
|
void unsetWebsite_url();
|
||||||
void setGameId(const utility::string_t& value);
|
void setWebsiteUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getWebsiteUrl() const;
|
utility::string_t getBannerUrl() const;
|
||||||
bool websiteUrlIsSet() const;
|
bool bannerUrlIsSet() const;
|
||||||
void unsetWebsite_url();
|
void unsetBanner_url();
|
||||||
void setWebsiteUrl(const utility::string_t& value);
|
void setBannerUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBannerUrl() const;
|
utility::string_t getOwnerId() const;
|
||||||
bool bannerUrlIsSet() const;
|
bool ownerIdIsSet() const;
|
||||||
void unsetBanner_url();
|
void unsetOwner_id();
|
||||||
void setBannerUrl(const utility::string_t& value);
|
void setOwnerId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getOwnerId() const;
|
utility::string_t getDiscordServerId() const;
|
||||||
bool ownerIdIsSet() const;
|
bool discordServerIdIsSet() const;
|
||||||
void unsetOwner_id();
|
void unsetDiscord_server_id();
|
||||||
void setOwnerId(const utility::string_t& value);
|
void setDiscordServerId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDiscordServerId() const;
|
utility::string_t getYoutubeVideoUrl() const;
|
||||||
bool discordServerIdIsSet() const;
|
bool youtubeVideoUrlIsSet() const;
|
||||||
void unsetDiscord_server_id();
|
void unsetYoutube_video_url();
|
||||||
void setDiscordServerId(const utility::string_t& value);
|
void setYoutubeVideoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getYoutubeVideoUrl() const;
|
utility::string_t getTags() const;
|
||||||
bool youtubeVideoUrlIsSet() const;
|
bool tagsIsSet() const;
|
||||||
void unsetYoutube_video_url();
|
void unsetTags();
|
||||||
void setYoutubeVideoUrl(const utility::string_t& value);
|
void setTags(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getTags() const;
|
int32_t getCommentCount() const;
|
||||||
bool tagsIsSet() const;
|
bool commentCountIsSet() const;
|
||||||
void unsetTags();
|
void unsetComment_count();
|
||||||
void setTags(const utility::string_t& value);
|
void setCommentCount(int32_t value);
|
||||||
|
|
||||||
int32_t getCommentCount() const;
|
int32_t getServerCount() const;
|
||||||
bool commentCountIsSet() const;
|
bool serverCountIsSet() const;
|
||||||
void unsetComment_count();
|
void unsetServer_count();
|
||||||
void setCommentCount(int32_t value);
|
void setServerCount(int32_t value);
|
||||||
|
|
||||||
int32_t getServerCount() const;
|
utility::datetime getCreated() const;
|
||||||
bool serverCountIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetServer_count();
|
void unsetCreated();
|
||||||
void setServerCount(int32_t value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Description;
|
||||||
utility::string_t m_Id;
|
bool m_DescriptionIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Game_id;
|
||||||
bool m_NameIsSet;
|
bool m_Game_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Description;
|
utility::string_t m_Website_url;
|
||||||
bool m_DescriptionIsSet;
|
bool m_Website_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Game_id;
|
utility::string_t m_Banner_url;
|
||||||
bool m_Game_idIsSet;
|
bool m_Banner_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Website_url;
|
utility::string_t m_Owner_id;
|
||||||
bool m_Website_urlIsSet;
|
bool m_Owner_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Banner_url;
|
utility::string_t m_Discord_server_id;
|
||||||
bool m_Banner_urlIsSet;
|
bool m_Discord_server_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Owner_id;
|
utility::string_t m_Youtube_video_url;
|
||||||
bool m_Owner_idIsSet;
|
bool m_Youtube_video_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Discord_server_id;
|
utility::string_t m_Tags;
|
||||||
bool m_Discord_server_idIsSet;
|
bool m_TagsIsSet;
|
||||||
|
|
||||||
utility::string_t m_Youtube_video_url;
|
int32_t m_Comment_count;
|
||||||
bool m_Youtube_video_urlIsSet;
|
bool m_Comment_countIsSet;
|
||||||
|
|
||||||
utility::string_t m_Tags;
|
int32_t m_Server_count;
|
||||||
bool m_TagsIsSet;
|
bool m_Server_countIsSet;
|
||||||
|
|
||||||
int32_t m_Comment_count;
|
utility::datetime m_Created;
|
||||||
bool m_Comment_countIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
int32_t m_Server_count;
|
utility::datetime m_Updated;
|
||||||
bool m_Server_countIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_GameServerCluster_H_ */
|
#endif /* TRIBUFU_MODELS_GameServerCluster_H_ */
|
||||||
|
@ -13,54 +13,54 @@
|
|||||||
/*
|
/*
|
||||||
* GrantType.h
|
* GrantType.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_GrantType_H_
|
#ifndef TRIBUFU_MODELS_GrantType_H_
|
||||||
#define TRIBUFU_MODELS_GrantType_H_
|
#define TRIBUFU_MODELS_GrantType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class GrantType
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
GrantType();
|
|
||||||
virtual ~GrantType();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eGrantType
|
|
||||||
{
|
{
|
||||||
GrantType_AUTHORIZATION_CODE,
|
|
||||||
GrantType_CLIENT_CREDENTIALS,
|
|
||||||
GrantType_PASSWORD,
|
|
||||||
GrantType_REFRESH_TOKEN,
|
|
||||||
};
|
|
||||||
|
|
||||||
eGrantType getValue() const;
|
class GrantType : public ModelBase
|
||||||
void setValue(eGrantType const value);
|
{
|
||||||
|
public:
|
||||||
|
GrantType();
|
||||||
|
virtual ~GrantType();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eGrantType m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eGrantType
|
||||||
|
{
|
||||||
|
GrantType_AUTHORIZATION_CODE,
|
||||||
|
GrantType_CLIENT_CREDENTIALS,
|
||||||
|
GrantType_PASSWORD,
|
||||||
|
GrantType_REFRESH_TOKEN,
|
||||||
|
};
|
||||||
|
|
||||||
|
eGrantType getValue() const;
|
||||||
|
void setValue(eGrantType const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eGrantType m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_GrantType_H_ */
|
#endif /* TRIBUFU_MODELS_GrantType_H_ */
|
||||||
|
@ -13,179 +13,174 @@
|
|||||||
/*
|
/*
|
||||||
* Group.h
|
* Group.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_Group_H_
|
#ifndef TRIBUFU_MODELS_Group_H_
|
||||||
#define TRIBUFU_MODELS_Group_H_
|
#define TRIBUFU_MODELS_Group_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Group
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Group();
|
{
|
||||||
virtual ~Group();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Group : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
Group();
|
||||||
|
virtual ~Group();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// Group members
|
/// Group members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getUuid() const;
|
||||||
bool idIsSet() const;
|
bool uuidIsSet() const;
|
||||||
void unsetId();
|
void unsetUuid();
|
||||||
void setId(const utility::string_t& value);
|
void setUuid(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUuid() const;
|
utility::string_t getName() const;
|
||||||
bool uuidIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetUuid();
|
void unsetName();
|
||||||
void setUuid(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getTag() const;
|
||||||
bool nameIsSet() const;
|
bool tagIsSet() const;
|
||||||
void unsetName();
|
void unsetTag();
|
||||||
void setName(const utility::string_t& value);
|
void setTag(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getTag() const;
|
utility::string_t getDescription() const;
|
||||||
bool tagIsSet() const;
|
bool descriptionIsSet() const;
|
||||||
void unsetTag();
|
void unsetDescription();
|
||||||
void setTag(const utility::string_t& value);
|
void setDescription(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDescription() const;
|
int32_t getType() const;
|
||||||
bool descriptionIsSet() const;
|
bool typeIsSet() const;
|
||||||
void unsetDescription();
|
void unsetType();
|
||||||
void setDescription(const utility::string_t& value);
|
void setType(int32_t value);
|
||||||
|
|
||||||
int32_t getType() const;
|
int32_t getPrivacy() const;
|
||||||
bool typeIsSet() const;
|
bool privacyIsSet() const;
|
||||||
void unsetType();
|
void unsetPrivacy();
|
||||||
void setType(int32_t value);
|
void setPrivacy(int32_t value);
|
||||||
|
|
||||||
int32_t getPrivacy() const;
|
utility::string_t getOwnerId() const;
|
||||||
bool privacyIsSet() const;
|
bool ownerIdIsSet() const;
|
||||||
void unsetPrivacy();
|
void unsetOwner_id();
|
||||||
void setPrivacy(int32_t value);
|
void setOwnerId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getOwnerId() const;
|
bool isVerified() const;
|
||||||
bool ownerIdIsSet() const;
|
bool verifiedIsSet() const;
|
||||||
void unsetOwner_id();
|
void unsetVerified();
|
||||||
void setOwnerId(const utility::string_t& value);
|
void setVerified(bool value);
|
||||||
|
|
||||||
bool isVerified() const;
|
utility::string_t getPhotoUrl() const;
|
||||||
bool verifiedIsSet() const;
|
bool photoUrlIsSet() const;
|
||||||
void unsetVerified();
|
void unsetPhoto_url();
|
||||||
void setVerified(bool value);
|
void setPhotoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPhotoUrl() const;
|
utility::string_t getBannerUrl() const;
|
||||||
bool photoUrlIsSet() const;
|
bool bannerUrlIsSet() const;
|
||||||
void unsetPhoto_url();
|
void unsetBanner_url();
|
||||||
void setPhotoUrl(const utility::string_t& value);
|
void setBannerUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBannerUrl() const;
|
int32_t getMemberCount() const;
|
||||||
bool bannerUrlIsSet() const;
|
bool memberCountIsSet() const;
|
||||||
void unsetBanner_url();
|
void unsetMember_count();
|
||||||
void setBannerUrl(const utility::string_t& value);
|
void setMemberCount(int32_t value);
|
||||||
|
|
||||||
int32_t getMemberCount() const;
|
int32_t getFollowerCount() const;
|
||||||
bool memberCountIsSet() const;
|
bool followerCountIsSet() const;
|
||||||
void unsetMember_count();
|
void unsetFollower_count();
|
||||||
void setMemberCount(int32_t value);
|
void setFollowerCount(int32_t value);
|
||||||
|
|
||||||
int32_t getFollowerCount() const;
|
int32_t getViewCount() const;
|
||||||
bool followerCountIsSet() const;
|
bool viewCountIsSet() const;
|
||||||
void unsetFollower_count();
|
void unsetView_count();
|
||||||
void setFollowerCount(int32_t value);
|
void setViewCount(int32_t value);
|
||||||
|
|
||||||
int32_t getViewCount() const;
|
utility::datetime getCreated() const;
|
||||||
bool viewCountIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetView_count();
|
void unsetCreated();
|
||||||
void setViewCount(int32_t value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Uuid;
|
||||||
|
bool m_UuidIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Name;
|
||||||
utility::string_t m_Id;
|
bool m_NameIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Uuid;
|
utility::string_t m_Tag;
|
||||||
bool m_UuidIsSet;
|
bool m_TagIsSet;
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Description;
|
||||||
bool m_NameIsSet;
|
bool m_DescriptionIsSet;
|
||||||
|
|
||||||
utility::string_t m_Tag;
|
int32_t m_Type;
|
||||||
bool m_TagIsSet;
|
bool m_TypeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Description;
|
int32_t m_Privacy;
|
||||||
bool m_DescriptionIsSet;
|
bool m_PrivacyIsSet;
|
||||||
|
|
||||||
int32_t m_Type;
|
utility::string_t m_Owner_id;
|
||||||
bool m_TypeIsSet;
|
bool m_Owner_idIsSet;
|
||||||
|
|
||||||
int32_t m_Privacy;
|
bool m_Verified;
|
||||||
bool m_PrivacyIsSet;
|
bool m_VerifiedIsSet;
|
||||||
|
|
||||||
utility::string_t m_Owner_id;
|
utility::string_t m_Photo_url;
|
||||||
bool m_Owner_idIsSet;
|
bool m_Photo_urlIsSet;
|
||||||
|
|
||||||
bool m_Verified;
|
utility::string_t m_Banner_url;
|
||||||
bool m_VerifiedIsSet;
|
bool m_Banner_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Photo_url;
|
int32_t m_Member_count;
|
||||||
bool m_Photo_urlIsSet;
|
bool m_Member_countIsSet;
|
||||||
|
|
||||||
utility::string_t m_Banner_url;
|
int32_t m_Follower_count;
|
||||||
bool m_Banner_urlIsSet;
|
bool m_Follower_countIsSet;
|
||||||
|
|
||||||
int32_t m_Member_count;
|
int32_t m_View_count;
|
||||||
bool m_Member_countIsSet;
|
bool m_View_countIsSet;
|
||||||
|
|
||||||
int32_t m_Follower_count;
|
utility::datetime m_Created;
|
||||||
bool m_Follower_countIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
int32_t m_View_count;
|
utility::datetime m_Updated;
|
||||||
bool m_View_countIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Group_H_ */
|
#endif /* TRIBUFU_MODELS_Group_H_ */
|
||||||
|
@ -13,112 +13,108 @@
|
|||||||
/*
|
/*
|
||||||
* GroupGame.h
|
* GroupGame.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_GroupGame_H_
|
#ifndef TRIBUFU_MODELS_GroupGame_H_
|
||||||
#define TRIBUFU_MODELS_GroupGame_H_
|
#define TRIBUFU_MODELS_GroupGame_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include "tribufu++/model/Application.h"
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/Group.h"
|
|
||||||
#include "tribufu++/AnyType.h"
|
#include "tribufu++/AnyType.h"
|
||||||
|
#include "tribufu++/model/Application.h"
|
||||||
|
#include "tribufu++/model/Group.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class Group;
|
|
||||||
class Application;
|
|
||||||
|
|
||||||
|
|
||||||
class GroupGame
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
GroupGame();
|
{
|
||||||
virtual ~GroupGame();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Group;
|
||||||
/// ModelBase overrides
|
class Application;
|
||||||
|
|
||||||
void validate() override;
|
class GroupGame : public ModelBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GroupGame();
|
||||||
|
virtual ~GroupGame();
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
/////////////////////////////////////////////
|
||||||
bool fromJson(const web::json::value& json) override;
|
/// ModelBase overrides
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
void validate() override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
/// GroupGame members
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////
|
||||||
|
/// GroupGame members
|
||||||
|
|
||||||
utility::string_t getGroupId() const;
|
utility::string_t getGroupId() const;
|
||||||
bool groupIdIsSet() const;
|
bool groupIdIsSet() const;
|
||||||
void unsetGroup_id();
|
void unsetGroup_id();
|
||||||
void setGroupId(const utility::string_t& value);
|
void setGroupId(const utility::string_t &value);
|
||||||
|
|
||||||
std::shared_ptr<Group> getGroup() const;
|
std::shared_ptr<Group> getGroup() const;
|
||||||
bool groupIsSet() const;
|
bool groupIsSet() const;
|
||||||
void unsetGroup();
|
void unsetGroup();
|
||||||
void setGroup(const std::shared_ptr<Group>& value);
|
void setGroup(const std::shared_ptr<Group> &value);
|
||||||
|
|
||||||
utility::string_t getApplicationId() const;
|
utility::string_t getApplicationId() const;
|
||||||
bool applicationIdIsSet() const;
|
bool applicationIdIsSet() const;
|
||||||
void unsetApplication_id();
|
void unsetApplication_id();
|
||||||
void setApplicationId(const utility::string_t& value);
|
void setApplicationId(const utility::string_t &value);
|
||||||
|
|
||||||
std::shared_ptr<Application> getApplication() const;
|
std::shared_ptr<Application> getApplication() const;
|
||||||
bool applicationIsSet() const;
|
bool applicationIsSet() const;
|
||||||
void unsetApplication();
|
void unsetApplication();
|
||||||
void setApplication(const std::shared_ptr<Application>& value);
|
void setApplication(const std::shared_ptr<Application> &value);
|
||||||
|
|
||||||
std::shared_ptr<AnyType> getStats() const;
|
std::shared_ptr<AnyType> getStats() const;
|
||||||
bool statsIsSet() const;
|
bool statsIsSet() const;
|
||||||
void unsetStats();
|
void unsetStats();
|
||||||
void setStats(const std::shared_ptr<AnyType>& value);
|
void setStats(const std::shared_ptr<AnyType> &value);
|
||||||
|
|
||||||
utility::datetime getAcquired() const;
|
utility::datetime getAcquired() const;
|
||||||
bool acquiredIsSet() const;
|
bool acquiredIsSet() const;
|
||||||
void unsetAcquired();
|
void unsetAcquired();
|
||||||
void setAcquired(const utility::datetime& value);
|
void setAcquired(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getLastUsed() const;
|
utility::datetime getLastUsed() const;
|
||||||
bool lastUsedIsSet() const;
|
bool lastUsedIsSet() const;
|
||||||
void unsetLast_used();
|
void unsetLast_used();
|
||||||
void setLastUsed(const utility::datetime& value);
|
void setLastUsed(const utility::datetime &value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
utility::string_t m_Group_id;
|
||||||
|
bool m_Group_idIsSet;
|
||||||
|
|
||||||
protected:
|
std::shared_ptr<Group> m_Group;
|
||||||
utility::string_t m_Group_id;
|
bool m_GroupIsSet;
|
||||||
bool m_Group_idIsSet;
|
|
||||||
|
|
||||||
std::shared_ptr<Group> m_Group;
|
utility::string_t m_Application_id;
|
||||||
bool m_GroupIsSet;
|
bool m_Application_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Application_id;
|
std::shared_ptr<Application> m_Application;
|
||||||
bool m_Application_idIsSet;
|
bool m_ApplicationIsSet;
|
||||||
|
|
||||||
std::shared_ptr<Application> m_Application;
|
std::shared_ptr<AnyType> m_Stats;
|
||||||
bool m_ApplicationIsSet;
|
bool m_StatsIsSet;
|
||||||
|
|
||||||
std::shared_ptr<AnyType> m_Stats;
|
utility::datetime m_Acquired;
|
||||||
bool m_StatsIsSet;
|
bool m_AcquiredIsSet;
|
||||||
|
|
||||||
utility::datetime m_Acquired;
|
utility::datetime m_Last_used;
|
||||||
bool m_AcquiredIsSet;
|
bool m_Last_usedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Last_used;
|
}
|
||||||
bool m_Last_usedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_GroupGame_H_ */
|
#endif /* TRIBUFU_MODELS_GroupGame_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* GroupMember.h
|
* GroupMember.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_GroupMember_H_
|
#ifndef TRIBUFU_MODELS_GroupMember_H_
|
||||||
@ -23,115 +23,111 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/GroupRank.h"
|
#include "tribufu++/model/GroupRank.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class GroupMember
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
GroupMember();
|
{
|
||||||
virtual ~GroupMember();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class GroupMember : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
GroupMember();
|
||||||
|
virtual ~GroupMember();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// GroupMember members
|
/// GroupMember members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getUuid() const;
|
||||||
bool idIsSet() const;
|
bool uuidIsSet() const;
|
||||||
void unsetId();
|
void unsetUuid();
|
||||||
void setId(const utility::string_t& value);
|
void setUuid(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUuid() const;
|
utility::string_t getName() const;
|
||||||
bool uuidIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetUuid();
|
void unsetName();
|
||||||
void setUuid(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDisplayName() const;
|
||||||
bool nameIsSet() const;
|
bool displayNameIsSet() const;
|
||||||
void unsetName();
|
void unsetDisplay_name();
|
||||||
void setName(const utility::string_t& value);
|
void setDisplayName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDisplayName() const;
|
bool isVerified() const;
|
||||||
bool displayNameIsSet() const;
|
bool verifiedIsSet() const;
|
||||||
void unsetDisplay_name();
|
void unsetVerified();
|
||||||
void setDisplayName(const utility::string_t& value);
|
void setVerified(bool value);
|
||||||
|
|
||||||
bool isVerified() const;
|
utility::string_t getPhotoUrl() const;
|
||||||
bool verifiedIsSet() const;
|
bool photoUrlIsSet() const;
|
||||||
void unsetVerified();
|
void unsetPhoto_url();
|
||||||
void setVerified(bool value);
|
void setPhotoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPhotoUrl() const;
|
utility::datetime getLastOnline() const;
|
||||||
bool photoUrlIsSet() const;
|
bool lastOnlineIsSet() const;
|
||||||
void unsetPhoto_url();
|
void unsetLast_online();
|
||||||
void setPhotoUrl(const utility::string_t& value);
|
void setLastOnline(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getLastOnline() const;
|
std::shared_ptr<GroupRank> getRank() const;
|
||||||
bool lastOnlineIsSet() const;
|
bool rankIsSet() const;
|
||||||
void unsetLast_online();
|
void unsetRank();
|
||||||
void setLastOnline(const utility::datetime& value);
|
void setRank(const std::shared_ptr<GroupRank> &value);
|
||||||
|
|
||||||
std::shared_ptr<GroupRank> getRank() const;
|
utility::datetime getSince() const;
|
||||||
bool rankIsSet() const;
|
bool sinceIsSet() const;
|
||||||
void unsetRank();
|
void unsetSince();
|
||||||
void setRank(const std::shared_ptr<GroupRank>& value);
|
void setSince(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getSince() const;
|
protected:
|
||||||
bool sinceIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetSince();
|
bool m_IdIsSet;
|
||||||
void setSince(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Uuid;
|
||||||
|
bool m_UuidIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Name;
|
||||||
utility::string_t m_Id;
|
bool m_NameIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Uuid;
|
utility::string_t m_Display_name;
|
||||||
bool m_UuidIsSet;
|
bool m_Display_nameIsSet;
|
||||||
|
|
||||||
utility::string_t m_Name;
|
bool m_Verified;
|
||||||
bool m_NameIsSet;
|
bool m_VerifiedIsSet;
|
||||||
|
|
||||||
utility::string_t m_Display_name;
|
utility::string_t m_Photo_url;
|
||||||
bool m_Display_nameIsSet;
|
bool m_Photo_urlIsSet;
|
||||||
|
|
||||||
bool m_Verified;
|
utility::datetime m_Last_online;
|
||||||
bool m_VerifiedIsSet;
|
bool m_Last_onlineIsSet;
|
||||||
|
|
||||||
utility::string_t m_Photo_url;
|
std::shared_ptr<GroupRank> m_Rank;
|
||||||
bool m_Photo_urlIsSet;
|
bool m_RankIsSet;
|
||||||
|
|
||||||
utility::datetime m_Last_online;
|
utility::datetime m_Since;
|
||||||
bool m_Last_onlineIsSet;
|
bool m_SinceIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
std::shared_ptr<GroupRank> m_Rank;
|
}
|
||||||
bool m_RankIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Since;
|
|
||||||
bool m_SinceIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_GroupMember_H_ */
|
#endif /* TRIBUFU_MODELS_GroupMember_H_ */
|
||||||
|
@ -13,53 +13,53 @@
|
|||||||
/*
|
/*
|
||||||
* GroupRank.h
|
* GroupRank.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_GroupRank_H_
|
#ifndef TRIBUFU_MODELS_GroupRank_H_
|
||||||
#define TRIBUFU_MODELS_GroupRank_H_
|
#define TRIBUFU_MODELS_GroupRank_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class GroupRank
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
GroupRank();
|
|
||||||
virtual ~GroupRank();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eGroupRank
|
|
||||||
{
|
{
|
||||||
GroupRank_MEMBER,
|
|
||||||
GroupRank_LEADER,
|
|
||||||
GroupRank_OWNER,
|
|
||||||
};
|
|
||||||
|
|
||||||
eGroupRank getValue() const;
|
class GroupRank : public ModelBase
|
||||||
void setValue(eGroupRank const value);
|
{
|
||||||
|
public:
|
||||||
|
GroupRank();
|
||||||
|
virtual ~GroupRank();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eGroupRank m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eGroupRank
|
||||||
|
{
|
||||||
|
GroupRank_MEMBER,
|
||||||
|
GroupRank_LEADER,
|
||||||
|
GroupRank_OWNER,
|
||||||
|
};
|
||||||
|
|
||||||
|
eGroupRank getValue() const;
|
||||||
|
void setValue(eGroupRank const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eGroupRank m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_GroupRank_H_ */
|
#endif /* TRIBUFU_MODELS_GroupRank_H_ */
|
||||||
|
@ -13,59 +13,54 @@
|
|||||||
/*
|
/*
|
||||||
* HashViewModel.h
|
* HashViewModel.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_HashViewModel_H_
|
#ifndef TRIBUFU_MODELS_HashViewModel_H_
|
||||||
#define TRIBUFU_MODELS_HashViewModel_H_
|
#define TRIBUFU_MODELS_HashViewModel_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HashViewModel
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
HashViewModel();
|
{
|
||||||
virtual ~HashViewModel();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class HashViewModel : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
HashViewModel();
|
||||||
|
virtual ~HashViewModel();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// HashViewModel members
|
/// HashViewModel members
|
||||||
|
|
||||||
|
utility::string_t getValue() const;
|
||||||
|
bool valueIsSet() const;
|
||||||
|
void unsetValue();
|
||||||
|
void setValue(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getValue() const;
|
protected:
|
||||||
bool valueIsSet() const;
|
utility::string_t m_Value;
|
||||||
void unsetValue();
|
bool m_ValueIsSet;
|
||||||
void setValue(const utility::string_t& value);
|
};
|
||||||
|
|
||||||
|
}
|
||||||
protected:
|
|
||||||
utility::string_t m_Value;
|
|
||||||
bool m_ValueIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_HashViewModel_H_ */
|
#endif /* TRIBUFU_MODELS_HashViewModel_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* IntrospectRequest.h
|
* IntrospectRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_IntrospectRequest_H_
|
#ifndef TRIBUFU_MODELS_IntrospectRequest_H_
|
||||||
@ -23,59 +23,55 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/TokenHintType.h"
|
#include "tribufu++/model/TokenHintType.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class IntrospectRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
IntrospectRequest();
|
{
|
||||||
virtual ~IntrospectRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class IntrospectRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
IntrospectRequest();
|
||||||
|
virtual ~IntrospectRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// IntrospectRequest members
|
/// IntrospectRequest members
|
||||||
|
|
||||||
|
utility::string_t getToken() const;
|
||||||
|
bool tokenIsSet() const;
|
||||||
|
void unsetToken();
|
||||||
|
void setToken(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getToken() const;
|
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
||||||
bool tokenIsSet() const;
|
bool tokenTypeHintIsSet() const;
|
||||||
void unsetToken();
|
void unsetToken_type_hint();
|
||||||
void setToken(const utility::string_t& value);
|
void setTokenTypeHint(const std::shared_ptr<TokenHintType> &value);
|
||||||
|
|
||||||
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
protected:
|
||||||
bool tokenTypeHintIsSet() const;
|
utility::string_t m_Token;
|
||||||
void unsetToken_type_hint();
|
bool m_TokenIsSet;
|
||||||
void setTokenTypeHint(const std::shared_ptr<TokenHintType>& value);
|
|
||||||
|
|
||||||
|
std::shared_ptr<TokenHintType> m_Token_type_hint;
|
||||||
|
bool m_Token_type_hintIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
}
|
||||||
utility::string_t m_Token;
|
|
||||||
bool m_TokenIsSet;
|
|
||||||
|
|
||||||
std::shared_ptr<TokenHintType> m_Token_type_hint;
|
|
||||||
bool m_Token_type_hintIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_IntrospectRequest_H_ */
|
#endif /* TRIBUFU_MODELS_IntrospectRequest_H_ */
|
||||||
|
@ -13,195 +13,190 @@
|
|||||||
/*
|
/*
|
||||||
* IpAddress.h
|
* IpAddress.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_IpAddress_H_
|
#ifndef TRIBUFU_MODELS_IpAddress_H_
|
||||||
#define TRIBUFU_MODELS_IpAddress_H_
|
#define TRIBUFU_MODELS_IpAddress_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class IpAddress
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
IpAddress();
|
{
|
||||||
virtual ~IpAddress();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class IpAddress : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
IpAddress();
|
||||||
|
virtual ~IpAddress();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// IpAddress members
|
/// IpAddress members
|
||||||
|
|
||||||
|
utility::string_t getAddress() const;
|
||||||
|
bool addressIsSet() const;
|
||||||
|
void unsetAddress();
|
||||||
|
void setAddress(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getAddress() const;
|
int32_t getVersion() const;
|
||||||
bool addressIsSet() const;
|
bool versionIsSet() const;
|
||||||
void unsetAddress();
|
void unsetVersion();
|
||||||
void setAddress(const utility::string_t& value);
|
void setVersion(int32_t value);
|
||||||
|
|
||||||
int32_t getVersion() const;
|
utility::string_t getNetwork() const;
|
||||||
bool versionIsSet() const;
|
bool networkIsSet() const;
|
||||||
void unsetVersion();
|
void unsetNetwork();
|
||||||
void setVersion(int32_t value);
|
void setNetwork(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getNetwork() const;
|
bool isReserved() const;
|
||||||
bool networkIsSet() const;
|
bool reservedIsSet() const;
|
||||||
void unsetNetwork();
|
void unsetReserved();
|
||||||
void setNetwork(const utility::string_t& value);
|
void setReserved(bool value);
|
||||||
|
|
||||||
bool isReserved() const;
|
utility::string_t getAsn() const;
|
||||||
bool reservedIsSet() const;
|
bool asnIsSet() const;
|
||||||
void unsetReserved();
|
void unsetAsn();
|
||||||
void setReserved(bool value);
|
void setAsn(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getAsn() const;
|
utility::string_t getIsp() const;
|
||||||
bool asnIsSet() const;
|
bool ispIsSet() const;
|
||||||
void unsetAsn();
|
void unsetIsp();
|
||||||
void setAsn(const utility::string_t& value);
|
void setIsp(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getIsp() const;
|
utility::string_t getContinent() const;
|
||||||
bool ispIsSet() const;
|
bool continentIsSet() const;
|
||||||
void unsetIsp();
|
void unsetContinent();
|
||||||
void setIsp(const utility::string_t& value);
|
void setContinent(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getContinent() const;
|
utility::string_t getCountry() const;
|
||||||
bool continentIsSet() const;
|
bool countryIsSet() const;
|
||||||
void unsetContinent();
|
void unsetCountry();
|
||||||
void setContinent(const utility::string_t& value);
|
void setCountry(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCountry() const;
|
utility::string_t getRegion() const;
|
||||||
bool countryIsSet() const;
|
bool regionIsSet() const;
|
||||||
void unsetCountry();
|
void unsetRegion();
|
||||||
void setCountry(const utility::string_t& value);
|
void setRegion(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getRegion() const;
|
utility::string_t getCity() const;
|
||||||
bool regionIsSet() const;
|
bool cityIsSet() const;
|
||||||
void unsetRegion();
|
void unsetCity();
|
||||||
void setRegion(const utility::string_t& value);
|
void setCity(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCity() const;
|
utility::string_t getPostalCode() const;
|
||||||
bool cityIsSet() const;
|
bool postalCodeIsSet() const;
|
||||||
void unsetCity();
|
void unsetPostal_code();
|
||||||
void setCity(const utility::string_t& value);
|
void setPostalCode(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPostalCode() const;
|
utility::string_t getCallingCode() const;
|
||||||
bool postalCodeIsSet() const;
|
bool callingCodeIsSet() const;
|
||||||
void unsetPostal_code();
|
void unsetCalling_code();
|
||||||
void setPostalCode(const utility::string_t& value);
|
void setCallingCode(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCallingCode() const;
|
utility::string_t getTld() const;
|
||||||
bool callingCodeIsSet() const;
|
bool tldIsSet() const;
|
||||||
void unsetCalling_code();
|
void unsetTld();
|
||||||
void setCallingCode(const utility::string_t& value);
|
void setTld(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getTld() const;
|
utility::string_t getLanguage() const;
|
||||||
bool tldIsSet() const;
|
bool languageIsSet() const;
|
||||||
void unsetTld();
|
void unsetLanguage();
|
||||||
void setTld(const utility::string_t& value);
|
void setLanguage(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLanguage() const;
|
utility::string_t getTimezone() const;
|
||||||
bool languageIsSet() const;
|
bool timezoneIsSet() const;
|
||||||
void unsetLanguage();
|
void unsetTimezone();
|
||||||
void setLanguage(const utility::string_t& value);
|
void setTimezone(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getTimezone() const;
|
utility::string_t getCurrency() const;
|
||||||
bool timezoneIsSet() const;
|
bool currencyIsSet() const;
|
||||||
void unsetTimezone();
|
void unsetCurrency();
|
||||||
void setTimezone(const utility::string_t& value);
|
void setCurrency(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCurrency() const;
|
float getLatitude() const;
|
||||||
bool currencyIsSet() const;
|
bool latitudeIsSet() const;
|
||||||
void unsetCurrency();
|
void unsetLatitude();
|
||||||
void setCurrency(const utility::string_t& value);
|
void setLatitude(float value);
|
||||||
|
|
||||||
float getLatitude() const;
|
float getLongitude() const;
|
||||||
bool latitudeIsSet() const;
|
bool longitudeIsSet() const;
|
||||||
void unsetLatitude();
|
void unsetLongitude();
|
||||||
void setLatitude(float value);
|
void setLongitude(float value);
|
||||||
|
|
||||||
float getLongitude() const;
|
protected:
|
||||||
bool longitudeIsSet() const;
|
utility::string_t m_Address;
|
||||||
void unsetLongitude();
|
bool m_AddressIsSet;
|
||||||
void setLongitude(float value);
|
|
||||||
|
|
||||||
|
int32_t m_Version;
|
||||||
|
bool m_VersionIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Network;
|
||||||
utility::string_t m_Address;
|
bool m_NetworkIsSet;
|
||||||
bool m_AddressIsSet;
|
|
||||||
|
|
||||||
int32_t m_Version;
|
bool m_Reserved;
|
||||||
bool m_VersionIsSet;
|
bool m_ReservedIsSet;
|
||||||
|
|
||||||
utility::string_t m_Network;
|
utility::string_t m_Asn;
|
||||||
bool m_NetworkIsSet;
|
bool m_AsnIsSet;
|
||||||
|
|
||||||
bool m_Reserved;
|
utility::string_t m_Isp;
|
||||||
bool m_ReservedIsSet;
|
bool m_IspIsSet;
|
||||||
|
|
||||||
utility::string_t m_Asn;
|
utility::string_t m_Continent;
|
||||||
bool m_AsnIsSet;
|
bool m_ContinentIsSet;
|
||||||
|
|
||||||
utility::string_t m_Isp;
|
utility::string_t m_Country;
|
||||||
bool m_IspIsSet;
|
bool m_CountryIsSet;
|
||||||
|
|
||||||
utility::string_t m_Continent;
|
utility::string_t m_Region;
|
||||||
bool m_ContinentIsSet;
|
bool m_RegionIsSet;
|
||||||
|
|
||||||
utility::string_t m_Country;
|
utility::string_t m_City;
|
||||||
bool m_CountryIsSet;
|
bool m_CityIsSet;
|
||||||
|
|
||||||
utility::string_t m_Region;
|
utility::string_t m_Postal_code;
|
||||||
bool m_RegionIsSet;
|
bool m_Postal_codeIsSet;
|
||||||
|
|
||||||
utility::string_t m_City;
|
utility::string_t m_Calling_code;
|
||||||
bool m_CityIsSet;
|
bool m_Calling_codeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Postal_code;
|
utility::string_t m_Tld;
|
||||||
bool m_Postal_codeIsSet;
|
bool m_TldIsSet;
|
||||||
|
|
||||||
utility::string_t m_Calling_code;
|
utility::string_t m_Language;
|
||||||
bool m_Calling_codeIsSet;
|
bool m_LanguageIsSet;
|
||||||
|
|
||||||
utility::string_t m_Tld;
|
utility::string_t m_Timezone;
|
||||||
bool m_TldIsSet;
|
bool m_TimezoneIsSet;
|
||||||
|
|
||||||
utility::string_t m_Language;
|
utility::string_t m_Currency;
|
||||||
bool m_LanguageIsSet;
|
bool m_CurrencyIsSet;
|
||||||
|
|
||||||
utility::string_t m_Timezone;
|
float m_Latitude;
|
||||||
bool m_TimezoneIsSet;
|
bool m_LatitudeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Currency;
|
float m_Longitude;
|
||||||
bool m_CurrencyIsSet;
|
bool m_LongitudeIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
float m_Latitude;
|
}
|
||||||
bool m_LatitudeIsSet;
|
|
||||||
|
|
||||||
float m_Longitude;
|
|
||||||
bool m_LongitudeIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_IpAddress_H_ */
|
#endif /* TRIBUFU_MODELS_IpAddress_H_ */
|
||||||
|
@ -13,99 +13,94 @@
|
|||||||
/*
|
/*
|
||||||
* LeaderboardItem.h
|
* LeaderboardItem.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_LeaderboardItem_H_
|
#ifndef TRIBUFU_MODELS_LeaderboardItem_H_
|
||||||
#define TRIBUFU_MODELS_LeaderboardItem_H_
|
#define TRIBUFU_MODELS_LeaderboardItem_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class LeaderboardItem
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
LeaderboardItem();
|
{
|
||||||
virtual ~LeaderboardItem();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class LeaderboardItem : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
LeaderboardItem();
|
||||||
|
virtual ~LeaderboardItem();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// LeaderboardItem members
|
/// LeaderboardItem members
|
||||||
|
|
||||||
|
utility::string_t getName() const;
|
||||||
|
bool nameIsSet() const;
|
||||||
|
void unsetName();
|
||||||
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDisplayName() const;
|
||||||
bool nameIsSet() const;
|
bool displayNameIsSet() const;
|
||||||
void unsetName();
|
void unsetDisplay_name();
|
||||||
void setName(const utility::string_t& value);
|
void setDisplayName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDisplayName() const;
|
utility::string_t getPhotoUrl() const;
|
||||||
bool displayNameIsSet() const;
|
bool photoUrlIsSet() const;
|
||||||
void unsetDisplay_name();
|
void unsetPhoto_url();
|
||||||
void setDisplayName(const utility::string_t& value);
|
void setPhotoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPhotoUrl() const;
|
int32_t getLevel() const;
|
||||||
bool photoUrlIsSet() const;
|
bool levelIsSet() const;
|
||||||
void unsetPhoto_url();
|
void unsetLevel();
|
||||||
void setPhotoUrl(const utility::string_t& value);
|
void setLevel(int32_t value);
|
||||||
|
|
||||||
int32_t getLevel() const;
|
double getExperience() const;
|
||||||
bool levelIsSet() const;
|
bool experienceIsSet() const;
|
||||||
void unsetLevel();
|
void unsetExperience();
|
||||||
void setLevel(int32_t value);
|
void setExperience(double value);
|
||||||
|
|
||||||
double getExperience() const;
|
double getPoints() const;
|
||||||
bool experienceIsSet() const;
|
bool pointsIsSet() const;
|
||||||
void unsetExperience();
|
void unsetPoints();
|
||||||
void setExperience(double value);
|
void setPoints(double value);
|
||||||
|
|
||||||
double getPoints() const;
|
protected:
|
||||||
bool pointsIsSet() const;
|
utility::string_t m_Name;
|
||||||
void unsetPoints();
|
bool m_NameIsSet;
|
||||||
void setPoints(double value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Display_name;
|
||||||
|
bool m_Display_nameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Photo_url;
|
||||||
utility::string_t m_Name;
|
bool m_Photo_urlIsSet;
|
||||||
bool m_NameIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Display_name;
|
int32_t m_Level;
|
||||||
bool m_Display_nameIsSet;
|
bool m_LevelIsSet;
|
||||||
|
|
||||||
utility::string_t m_Photo_url;
|
double m_Experience;
|
||||||
bool m_Photo_urlIsSet;
|
bool m_ExperienceIsSet;
|
||||||
|
|
||||||
int32_t m_Level;
|
double m_Points;
|
||||||
bool m_LevelIsSet;
|
bool m_PointsIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
double m_Experience;
|
}
|
||||||
bool m_ExperienceIsSet;
|
|
||||||
|
|
||||||
double m_Points;
|
|
||||||
bool m_PointsIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_LeaderboardItem_H_ */
|
#endif /* TRIBUFU_MODELS_LeaderboardItem_H_ */
|
||||||
|
@ -13,52 +13,52 @@
|
|||||||
/*
|
/*
|
||||||
* LeaderboardOrder.h
|
* LeaderboardOrder.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_LeaderboardOrder_H_
|
#ifndef TRIBUFU_MODELS_LeaderboardOrder_H_
|
||||||
#define TRIBUFU_MODELS_LeaderboardOrder_H_
|
#define TRIBUFU_MODELS_LeaderboardOrder_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class LeaderboardOrder
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
LeaderboardOrder();
|
|
||||||
virtual ~LeaderboardOrder();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eLeaderboardOrder
|
|
||||||
{
|
{
|
||||||
LeaderboardOrder_LEVEL,
|
|
||||||
LeaderboardOrder_POINTS,
|
|
||||||
};
|
|
||||||
|
|
||||||
eLeaderboardOrder getValue() const;
|
class LeaderboardOrder : public ModelBase
|
||||||
void setValue(eLeaderboardOrder const value);
|
{
|
||||||
|
public:
|
||||||
|
LeaderboardOrder();
|
||||||
|
virtual ~LeaderboardOrder();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eLeaderboardOrder m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eLeaderboardOrder
|
||||||
|
{
|
||||||
|
LeaderboardOrder_LEVEL,
|
||||||
|
LeaderboardOrder_POINTS,
|
||||||
|
};
|
||||||
|
|
||||||
|
eLeaderboardOrder getValue() const;
|
||||||
|
void setValue(eLeaderboardOrder const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eLeaderboardOrder m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_LeaderboardOrder_H_ */
|
#endif /* TRIBUFU_MODELS_LeaderboardOrder_H_ */
|
||||||
|
@ -13,57 +13,57 @@
|
|||||||
/*
|
/*
|
||||||
* LoginProvider.h
|
* LoginProvider.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_LoginProvider_H_
|
#ifndef TRIBUFU_MODELS_LoginProvider_H_
|
||||||
#define TRIBUFU_MODELS_LoginProvider_H_
|
#define TRIBUFU_MODELS_LoginProvider_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class LoginProvider
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
LoginProvider();
|
|
||||||
virtual ~LoginProvider();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eLoginProvider
|
|
||||||
{
|
{
|
||||||
LoginProvider_STEAM,
|
|
||||||
LoginProvider_EPIC,
|
|
||||||
LoginProvider_DISCORD,
|
|
||||||
LoginProvider_MICROSOFT,
|
|
||||||
LoginProvider_PLAYSTATION,
|
|
||||||
LoginProvider_GOOGLE,
|
|
||||||
LoginProvider_APPLE,
|
|
||||||
};
|
|
||||||
|
|
||||||
eLoginProvider getValue() const;
|
class LoginProvider : public ModelBase
|
||||||
void setValue(eLoginProvider const value);
|
{
|
||||||
|
public:
|
||||||
|
LoginProvider();
|
||||||
|
virtual ~LoginProvider();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eLoginProvider m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eLoginProvider
|
||||||
|
{
|
||||||
|
LoginProvider_STEAM,
|
||||||
|
LoginProvider_EPIC,
|
||||||
|
LoginProvider_DISCORD,
|
||||||
|
LoginProvider_MICROSOFT,
|
||||||
|
LoginProvider_PLAYSTATION,
|
||||||
|
LoginProvider_GOOGLE,
|
||||||
|
LoginProvider_APPLE,
|
||||||
|
};
|
||||||
|
|
||||||
|
eLoginProvider getValue() const;
|
||||||
|
void setValue(eLoginProvider const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eLoginProvider m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_LoginProvider_H_ */
|
#endif /* TRIBUFU_MODELS_LoginProvider_H_ */
|
||||||
|
@ -13,67 +13,62 @@
|
|||||||
/*
|
/*
|
||||||
* LoginRequest.h
|
* LoginRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_LoginRequest_H_
|
#ifndef TRIBUFU_MODELS_LoginRequest_H_
|
||||||
#define TRIBUFU_MODELS_LoginRequest_H_
|
#define TRIBUFU_MODELS_LoginRequest_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class LoginRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
LoginRequest();
|
{
|
||||||
virtual ~LoginRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class LoginRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
LoginRequest();
|
||||||
|
virtual ~LoginRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// LoginRequest members
|
/// LoginRequest members
|
||||||
|
|
||||||
|
utility::string_t getLogin() const;
|
||||||
|
bool loginIsSet() const;
|
||||||
|
void unsetLogin();
|
||||||
|
void setLogin(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLogin() const;
|
utility::string_t getPassword() const;
|
||||||
bool loginIsSet() const;
|
bool passwordIsSet() const;
|
||||||
void unsetLogin();
|
void unsetPassword();
|
||||||
void setLogin(const utility::string_t& value);
|
void setPassword(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPassword() const;
|
protected:
|
||||||
bool passwordIsSet() const;
|
utility::string_t m_Login;
|
||||||
void unsetPassword();
|
bool m_LoginIsSet;
|
||||||
void setPassword(const utility::string_t& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Password;
|
||||||
|
bool m_PasswordIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
}
|
||||||
utility::string_t m_Login;
|
|
||||||
bool m_LoginIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Password;
|
|
||||||
bool m_PasswordIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_LoginRequest_H_ */
|
#endif /* TRIBUFU_MODELS_LoginRequest_H_ */
|
||||||
|
@ -13,85 +13,81 @@
|
|||||||
/*
|
/*
|
||||||
* LoginResponse.h
|
* LoginResponse.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_LoginResponse_H_
|
#ifndef TRIBUFU_MODELS_LoginResponse_H_
|
||||||
#define TRIBUFU_MODELS_LoginResponse_H_
|
#define TRIBUFU_MODELS_LoginResponse_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include "tribufu++/model/UserInfo.h"
|
#include "tribufu++/model/UserInfo.h"
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
class UserInfo;
|
|
||||||
|
|
||||||
|
|
||||||
class LoginResponse
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
LoginResponse();
|
{
|
||||||
virtual ~LoginResponse();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class UserInfo;
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
class LoginResponse : public ModelBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LoginResponse();
|
||||||
|
virtual ~LoginResponse();
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
/////////////////////////////////////////////
|
||||||
bool fromJson(const web::json::value& json) override;
|
/// ModelBase overrides
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
void validate() override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
/// LoginResponse members
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////
|
||||||
|
/// LoginResponse members
|
||||||
|
|
||||||
std::shared_ptr<UserInfo> getUser() const;
|
std::shared_ptr<UserInfo> getUser() const;
|
||||||
bool userIsSet() const;
|
bool userIsSet() const;
|
||||||
void unsetUser();
|
void unsetUser();
|
||||||
void setUser(const std::shared_ptr<UserInfo>& value);
|
void setUser(const std::shared_ptr<UserInfo> &value);
|
||||||
|
|
||||||
utility::string_t getAccessToken() const;
|
utility::string_t getAccessToken() const;
|
||||||
bool accessTokenIsSet() const;
|
bool accessTokenIsSet() const;
|
||||||
void unsetAccess_token();
|
void unsetAccess_token();
|
||||||
void setAccessToken(const utility::string_t& value);
|
void setAccessToken(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getRefreshToken() const;
|
utility::string_t getRefreshToken() const;
|
||||||
bool refreshTokenIsSet() const;
|
bool refreshTokenIsSet() const;
|
||||||
void unsetRefresh_token();
|
void unsetRefresh_token();
|
||||||
void setRefreshToken(const utility::string_t& value);
|
void setRefreshToken(const utility::string_t &value);
|
||||||
|
|
||||||
int64_t getExpiresIn() const;
|
int64_t getExpiresIn() const;
|
||||||
bool expiresInIsSet() const;
|
bool expiresInIsSet() const;
|
||||||
void unsetExpires_in();
|
void unsetExpires_in();
|
||||||
void setExpiresIn(int64_t value);
|
void setExpiresIn(int64_t value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::shared_ptr<UserInfo> m_User;
|
||||||
|
bool m_UserIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Access_token;
|
||||||
std::shared_ptr<UserInfo> m_User;
|
bool m_Access_tokenIsSet;
|
||||||
bool m_UserIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Access_token;
|
utility::string_t m_Refresh_token;
|
||||||
bool m_Access_tokenIsSet;
|
bool m_Refresh_tokenIsSet;
|
||||||
|
|
||||||
utility::string_t m_Refresh_token;
|
int64_t m_Expires_in;
|
||||||
bool m_Refresh_tokenIsSet;
|
bool m_Expires_inIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
int64_t m_Expires_in;
|
}
|
||||||
bool m_Expires_inIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_LoginResponse_H_ */
|
#endif /* TRIBUFU_MODELS_LoginResponse_H_ */
|
||||||
|
@ -13,147 +13,142 @@
|
|||||||
/*
|
/*
|
||||||
* Package.h
|
* Package.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_Package_H_
|
#ifndef TRIBUFU_MODELS_Package_H_
|
||||||
#define TRIBUFU_MODELS_Package_H_
|
#define TRIBUFU_MODELS_Package_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Package
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Package();
|
{
|
||||||
virtual ~Package();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Package : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
Package();
|
||||||
|
virtual ~Package();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// Package members
|
/// Package members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getName() const;
|
||||||
bool idIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetId();
|
void unsetName();
|
||||||
void setId(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDescription() const;
|
||||||
bool nameIsSet() const;
|
bool descriptionIsSet() const;
|
||||||
void unsetName();
|
void unsetDescription();
|
||||||
void setName(const utility::string_t& value);
|
void setDescription(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDescription() const;
|
utility::string_t getImageUrl() const;
|
||||||
bool descriptionIsSet() const;
|
bool imageUrlIsSet() const;
|
||||||
void unsetDescription();
|
void unsetImage_url();
|
||||||
void setDescription(const utility::string_t& value);
|
void setImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getImageUrl() const;
|
utility::string_t getAuthorId() const;
|
||||||
bool imageUrlIsSet() const;
|
bool authorIdIsSet() const;
|
||||||
void unsetImage_url();
|
void unsetAuthor_id();
|
||||||
void setImageUrl(const utility::string_t& value);
|
void setAuthorId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getAuthorId() const;
|
utility::string_t getVersion() const;
|
||||||
bool authorIdIsSet() const;
|
bool versionIsSet() const;
|
||||||
void unsetAuthor_id();
|
void unsetVersion();
|
||||||
void setAuthorId(const utility::string_t& value);
|
void setVersion(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getVersion() const;
|
utility::string_t getFileUrl() const;
|
||||||
bool versionIsSet() const;
|
bool fileUrlIsSet() const;
|
||||||
void unsetVersion();
|
void unsetFile_url();
|
||||||
void setVersion(const utility::string_t& value);
|
void setFileUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getFileUrl() const;
|
double getRawSize() const;
|
||||||
bool fileUrlIsSet() const;
|
bool rawSizeIsSet() const;
|
||||||
void unsetFile_url();
|
void unsetRaw_size();
|
||||||
void setFileUrl(const utility::string_t& value);
|
void setRawSize(double value);
|
||||||
|
|
||||||
double getRawSize() const;
|
int32_t getDownloadCount() const;
|
||||||
bool rawSizeIsSet() const;
|
bool downloadCountIsSet() const;
|
||||||
void unsetRaw_size();
|
void unsetDownload_count();
|
||||||
void setRawSize(double value);
|
void setDownloadCount(int32_t value);
|
||||||
|
|
||||||
int32_t getDownloadCount() const;
|
utility::datetime getLastDownload() const;
|
||||||
bool downloadCountIsSet() const;
|
bool lastDownloadIsSet() const;
|
||||||
void unsetDownload_count();
|
void unsetLast_download();
|
||||||
void setDownloadCount(int32_t value);
|
void setLastDownload(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getLastDownload() const;
|
utility::datetime getCreated() const;
|
||||||
bool lastDownloadIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetLast_download();
|
void unsetCreated();
|
||||||
void setLastDownload(const utility::datetime& value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Description;
|
||||||
utility::string_t m_Id;
|
bool m_DescriptionIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Image_url;
|
||||||
bool m_NameIsSet;
|
bool m_Image_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Description;
|
utility::string_t m_Author_id;
|
||||||
bool m_DescriptionIsSet;
|
bool m_Author_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Image_url;
|
utility::string_t m_Version;
|
||||||
bool m_Image_urlIsSet;
|
bool m_VersionIsSet;
|
||||||
|
|
||||||
utility::string_t m_Author_id;
|
utility::string_t m_File_url;
|
||||||
bool m_Author_idIsSet;
|
bool m_File_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Version;
|
double m_Raw_size;
|
||||||
bool m_VersionIsSet;
|
bool m_Raw_sizeIsSet;
|
||||||
|
|
||||||
utility::string_t m_File_url;
|
int32_t m_Download_count;
|
||||||
bool m_File_urlIsSet;
|
bool m_Download_countIsSet;
|
||||||
|
|
||||||
double m_Raw_size;
|
utility::datetime m_Last_download;
|
||||||
bool m_Raw_sizeIsSet;
|
bool m_Last_downloadIsSet;
|
||||||
|
|
||||||
int32_t m_Download_count;
|
utility::datetime m_Created;
|
||||||
bool m_Download_countIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
utility::datetime m_Last_download;
|
utility::datetime m_Updated;
|
||||||
bool m_Last_downloadIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Package_H_ */
|
#endif /* TRIBUFU_MODELS_Package_H_ */
|
||||||
|
@ -13,195 +13,190 @@
|
|||||||
/*
|
/*
|
||||||
* Profile.h
|
* Profile.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_Profile_H_
|
#ifndef TRIBUFU_MODELS_Profile_H_
|
||||||
#define TRIBUFU_MODELS_Profile_H_
|
#define TRIBUFU_MODELS_Profile_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Profile
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Profile();
|
{
|
||||||
virtual ~Profile();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Profile : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
Profile();
|
||||||
|
virtual ~Profile();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// Profile members
|
/// Profile members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getUuid() const;
|
||||||
bool idIsSet() const;
|
bool uuidIsSet() const;
|
||||||
void unsetId();
|
void unsetUuid();
|
||||||
void setId(const utility::string_t& value);
|
void setUuid(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUuid() const;
|
utility::string_t getName() const;
|
||||||
bool uuidIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetUuid();
|
void unsetName();
|
||||||
void setUuid(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDisplayName() const;
|
||||||
bool nameIsSet() const;
|
bool displayNameIsSet() const;
|
||||||
void unsetName();
|
void unsetDisplay_name();
|
||||||
void setName(const utility::string_t& value);
|
void setDisplayName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDisplayName() const;
|
bool isVerified() const;
|
||||||
bool displayNameIsSet() const;
|
bool verifiedIsSet() const;
|
||||||
void unsetDisplay_name();
|
void unsetVerified();
|
||||||
void setDisplayName(const utility::string_t& value);
|
void setVerified(bool value);
|
||||||
|
|
||||||
bool isVerified() const;
|
int32_t getLevel() const;
|
||||||
bool verifiedIsSet() const;
|
bool levelIsSet() const;
|
||||||
void unsetVerified();
|
void unsetLevel();
|
||||||
void setVerified(bool value);
|
void setLevel(int32_t value);
|
||||||
|
|
||||||
int32_t getLevel() const;
|
double getExperience() const;
|
||||||
bool levelIsSet() const;
|
bool experienceIsSet() const;
|
||||||
void unsetLevel();
|
void unsetExperience();
|
||||||
void setLevel(int32_t value);
|
void setExperience(double value);
|
||||||
|
|
||||||
double getExperience() const;
|
bool isPublicBirthday() const;
|
||||||
bool experienceIsSet() const;
|
bool publicBirthdayIsSet() const;
|
||||||
void unsetExperience();
|
void unsetPublic_birthday();
|
||||||
void setExperience(double value);
|
void setPublicBirthday(bool value);
|
||||||
|
|
||||||
bool isPublicBirthday() const;
|
utility::datetime getBirthday() const;
|
||||||
bool publicBirthdayIsSet() const;
|
bool birthdayIsSet() const;
|
||||||
void unsetPublic_birthday();
|
void unsetBirthday();
|
||||||
void setPublicBirthday(bool value);
|
void setBirthday(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getBirthday() const;
|
double getPoints() const;
|
||||||
bool birthdayIsSet() const;
|
bool pointsIsSet() const;
|
||||||
void unsetBirthday();
|
void unsetPoints();
|
||||||
void setBirthday(const utility::datetime& value);
|
void setPoints(double value);
|
||||||
|
|
||||||
double getPoints() const;
|
utility::string_t getLocation() const;
|
||||||
bool pointsIsSet() const;
|
bool locationIsSet() const;
|
||||||
void unsetPoints();
|
void unsetLocation();
|
||||||
void setPoints(double value);
|
void setLocation(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLocation() const;
|
utility::string_t getPhotoUrl() const;
|
||||||
bool locationIsSet() const;
|
bool photoUrlIsSet() const;
|
||||||
void unsetLocation();
|
void unsetPhoto_url();
|
||||||
void setLocation(const utility::string_t& value);
|
void setPhotoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPhotoUrl() const;
|
utility::string_t getBannerUrl() const;
|
||||||
bool photoUrlIsSet() const;
|
bool bannerUrlIsSet() const;
|
||||||
void unsetPhoto_url();
|
void unsetBanner_url();
|
||||||
void setPhotoUrl(const utility::string_t& value);
|
void setBannerUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBannerUrl() const;
|
utility::datetime getLastOnline() const;
|
||||||
bool bannerUrlIsSet() const;
|
bool lastOnlineIsSet() const;
|
||||||
void unsetBanner_url();
|
void unsetLast_online();
|
||||||
void setBannerUrl(const utility::string_t& value);
|
void setLastOnline(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getLastOnline() const;
|
utility::string_t getBiography() const;
|
||||||
bool lastOnlineIsSet() const;
|
bool biographyIsSet() const;
|
||||||
void unsetLast_online();
|
void unsetBiography();
|
||||||
void setLastOnline(const utility::datetime& value);
|
void setBiography(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBiography() const;
|
int32_t getViewCount() const;
|
||||||
bool biographyIsSet() const;
|
bool viewCountIsSet() const;
|
||||||
void unsetBiography();
|
void unsetView_count();
|
||||||
void setBiography(const utility::string_t& value);
|
void setViewCount(int32_t value);
|
||||||
|
|
||||||
int32_t getViewCount() const;
|
utility::datetime getCreated() const;
|
||||||
bool viewCountIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetView_count();
|
void unsetCreated();
|
||||||
void setViewCount(int32_t value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Uuid;
|
||||||
|
bool m_UuidIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Name;
|
||||||
utility::string_t m_Id;
|
bool m_NameIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Uuid;
|
utility::string_t m_Display_name;
|
||||||
bool m_UuidIsSet;
|
bool m_Display_nameIsSet;
|
||||||
|
|
||||||
utility::string_t m_Name;
|
bool m_Verified;
|
||||||
bool m_NameIsSet;
|
bool m_VerifiedIsSet;
|
||||||
|
|
||||||
utility::string_t m_Display_name;
|
int32_t m_Level;
|
||||||
bool m_Display_nameIsSet;
|
bool m_LevelIsSet;
|
||||||
|
|
||||||
bool m_Verified;
|
double m_Experience;
|
||||||
bool m_VerifiedIsSet;
|
bool m_ExperienceIsSet;
|
||||||
|
|
||||||
int32_t m_Level;
|
bool m_Public_birthday;
|
||||||
bool m_LevelIsSet;
|
bool m_Public_birthdayIsSet;
|
||||||
|
|
||||||
double m_Experience;
|
utility::datetime m_Birthday;
|
||||||
bool m_ExperienceIsSet;
|
bool m_BirthdayIsSet;
|
||||||
|
|
||||||
bool m_Public_birthday;
|
double m_Points;
|
||||||
bool m_Public_birthdayIsSet;
|
bool m_PointsIsSet;
|
||||||
|
|
||||||
utility::datetime m_Birthday;
|
utility::string_t m_Location;
|
||||||
bool m_BirthdayIsSet;
|
bool m_LocationIsSet;
|
||||||
|
|
||||||
double m_Points;
|
utility::string_t m_Photo_url;
|
||||||
bool m_PointsIsSet;
|
bool m_Photo_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Location;
|
utility::string_t m_Banner_url;
|
||||||
bool m_LocationIsSet;
|
bool m_Banner_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Photo_url;
|
utility::datetime m_Last_online;
|
||||||
bool m_Photo_urlIsSet;
|
bool m_Last_onlineIsSet;
|
||||||
|
|
||||||
utility::string_t m_Banner_url;
|
utility::string_t m_Biography;
|
||||||
bool m_Banner_urlIsSet;
|
bool m_BiographyIsSet;
|
||||||
|
|
||||||
utility::datetime m_Last_online;
|
int32_t m_View_count;
|
||||||
bool m_Last_onlineIsSet;
|
bool m_View_countIsSet;
|
||||||
|
|
||||||
utility::string_t m_Biography;
|
utility::datetime m_Created;
|
||||||
bool m_BiographyIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
int32_t m_View_count;
|
utility::datetime m_Updated;
|
||||||
bool m_View_countIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Profile_H_ */
|
#endif /* TRIBUFU_MODELS_Profile_H_ */
|
||||||
|
@ -13,140 +13,135 @@
|
|||||||
/*
|
/*
|
||||||
* ProfileGame.h
|
* ProfileGame.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_ProfileGame_H_
|
#ifndef TRIBUFU_MODELS_ProfileGame_H_
|
||||||
#define TRIBUFU_MODELS_ProfileGame_H_
|
#define TRIBUFU_MODELS_ProfileGame_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/AnyType.h"
|
#include "tribufu++/AnyType.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ProfileGame
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
ProfileGame();
|
{
|
||||||
virtual ~ProfileGame();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class ProfileGame : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
ProfileGame();
|
||||||
|
virtual ~ProfileGame();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// ProfileGame members
|
/// ProfileGame members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getName() const;
|
||||||
bool idIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetId();
|
void unsetName();
|
||||||
void setId(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getCapsuleImageUrl() const;
|
||||||
bool nameIsSet() const;
|
bool capsuleImageUrlIsSet() const;
|
||||||
void unsetName();
|
void unsetCapsule_image_url();
|
||||||
void setName(const utility::string_t& value);
|
void setCapsuleImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCapsuleImageUrl() const;
|
utility::string_t getLibraryImageUrl() const;
|
||||||
bool capsuleImageUrlIsSet() const;
|
bool libraryImageUrlIsSet() const;
|
||||||
void unsetCapsule_image_url();
|
void unsetLibrary_image_url();
|
||||||
void setCapsuleImageUrl(const utility::string_t& value);
|
void setLibraryImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLibraryImageUrl() const;
|
utility::string_t getSlug() const;
|
||||||
bool libraryImageUrlIsSet() const;
|
bool slugIsSet() const;
|
||||||
void unsetLibrary_image_url();
|
void unsetSlug();
|
||||||
void setLibraryImageUrl(const utility::string_t& value);
|
void setSlug(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getSlug() const;
|
double getTimeUsed() const;
|
||||||
bool slugIsSet() const;
|
bool timeUsedIsSet() const;
|
||||||
void unsetSlug();
|
void unsetTime_used();
|
||||||
void setSlug(const utility::string_t& value);
|
void setTimeUsed(double value);
|
||||||
|
|
||||||
double getTimeUsed() const;
|
int32_t getUnlockedAchievements() const;
|
||||||
bool timeUsedIsSet() const;
|
bool unlockedAchievementsIsSet() const;
|
||||||
void unsetTime_used();
|
void unsetUnlocked_achievements();
|
||||||
void setTimeUsed(double value);
|
void setUnlockedAchievements(int32_t value);
|
||||||
|
|
||||||
int32_t getUnlockedAchievements() const;
|
int32_t getTotalAchievements() const;
|
||||||
bool unlockedAchievementsIsSet() const;
|
bool totalAchievementsIsSet() const;
|
||||||
void unsetUnlocked_achievements();
|
void unsetTotal_achievements();
|
||||||
void setUnlockedAchievements(int32_t value);
|
void setTotalAchievements(int32_t value);
|
||||||
|
|
||||||
int32_t getTotalAchievements() const;
|
std::shared_ptr<AnyType> getStats() const;
|
||||||
bool totalAchievementsIsSet() const;
|
bool statsIsSet() const;
|
||||||
void unsetTotal_achievements();
|
void unsetStats();
|
||||||
void setTotalAchievements(int32_t value);
|
void setStats(const std::shared_ptr<AnyType> &value);
|
||||||
|
|
||||||
std::shared_ptr<AnyType> getStats() const;
|
utility::datetime getAcquired() const;
|
||||||
bool statsIsSet() const;
|
bool acquiredIsSet() const;
|
||||||
void unsetStats();
|
void unsetAcquired();
|
||||||
void setStats(const std::shared_ptr<AnyType>& value);
|
void setAcquired(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getAcquired() const;
|
utility::datetime getLastUsed() const;
|
||||||
bool acquiredIsSet() const;
|
bool lastUsedIsSet() const;
|
||||||
void unsetAcquired();
|
void unsetLast_used();
|
||||||
void setAcquired(const utility::datetime& value);
|
void setLastUsed(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getLastUsed() const;
|
protected:
|
||||||
bool lastUsedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetLast_used();
|
bool m_IdIsSet;
|
||||||
void setLastUsed(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Capsule_image_url;
|
||||||
utility::string_t m_Id;
|
bool m_Capsule_image_urlIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Library_image_url;
|
||||||
bool m_NameIsSet;
|
bool m_Library_image_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Capsule_image_url;
|
utility::string_t m_Slug;
|
||||||
bool m_Capsule_image_urlIsSet;
|
bool m_SlugIsSet;
|
||||||
|
|
||||||
utility::string_t m_Library_image_url;
|
double m_Time_used;
|
||||||
bool m_Library_image_urlIsSet;
|
bool m_Time_usedIsSet;
|
||||||
|
|
||||||
utility::string_t m_Slug;
|
int32_t m_Unlocked_achievements;
|
||||||
bool m_SlugIsSet;
|
bool m_Unlocked_achievementsIsSet;
|
||||||
|
|
||||||
double m_Time_used;
|
int32_t m_Total_achievements;
|
||||||
bool m_Time_usedIsSet;
|
bool m_Total_achievementsIsSet;
|
||||||
|
|
||||||
int32_t m_Unlocked_achievements;
|
std::shared_ptr<AnyType> m_Stats;
|
||||||
bool m_Unlocked_achievementsIsSet;
|
bool m_StatsIsSet;
|
||||||
|
|
||||||
int32_t m_Total_achievements;
|
utility::datetime m_Acquired;
|
||||||
bool m_Total_achievementsIsSet;
|
bool m_AcquiredIsSet;
|
||||||
|
|
||||||
std::shared_ptr<AnyType> m_Stats;
|
utility::datetime m_Last_used;
|
||||||
bool m_StatsIsSet;
|
bool m_Last_usedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Acquired;
|
}
|
||||||
bool m_AcquiredIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Last_used;
|
|
||||||
bool m_Last_usedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_ProfileGame_H_ */
|
#endif /* TRIBUFU_MODELS_ProfileGame_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* ProfileGroup.h
|
* ProfileGroup.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_ProfileGroup_H_
|
#ifndef TRIBUFU_MODELS_ProfileGroup_H_
|
||||||
@ -23,123 +23,119 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/GroupRank.h"
|
#include "tribufu++/model/GroupRank.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ProfileGroup
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
ProfileGroup();
|
{
|
||||||
virtual ~ProfileGroup();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class ProfileGroup : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
ProfileGroup();
|
||||||
|
virtual ~ProfileGroup();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// ProfileGroup members
|
/// ProfileGroup members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getUuid() const;
|
||||||
bool idIsSet() const;
|
bool uuidIsSet() const;
|
||||||
void unsetId();
|
void unsetUuid();
|
||||||
void setId(const utility::string_t& value);
|
void setUuid(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUuid() const;
|
utility::string_t getName() const;
|
||||||
bool uuidIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetUuid();
|
void unsetName();
|
||||||
void setUuid(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getTag() const;
|
||||||
bool nameIsSet() const;
|
bool tagIsSet() const;
|
||||||
void unsetName();
|
void unsetTag();
|
||||||
void setName(const utility::string_t& value);
|
void setTag(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getTag() const;
|
int32_t getPrivacy() const;
|
||||||
bool tagIsSet() const;
|
bool privacyIsSet() const;
|
||||||
void unsetTag();
|
void unsetPrivacy();
|
||||||
void setTag(const utility::string_t& value);
|
void setPrivacy(int32_t value);
|
||||||
|
|
||||||
int32_t getPrivacy() const;
|
bool isVerified() const;
|
||||||
bool privacyIsSet() const;
|
bool verifiedIsSet() const;
|
||||||
void unsetPrivacy();
|
void unsetVerified();
|
||||||
void setPrivacy(int32_t value);
|
void setVerified(bool value);
|
||||||
|
|
||||||
bool isVerified() const;
|
utility::string_t getPhotoUrl() const;
|
||||||
bool verifiedIsSet() const;
|
bool photoUrlIsSet() const;
|
||||||
void unsetVerified();
|
void unsetPhoto_url();
|
||||||
void setVerified(bool value);
|
void setPhotoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPhotoUrl() const;
|
int32_t getMemberCount() const;
|
||||||
bool photoUrlIsSet() const;
|
bool memberCountIsSet() const;
|
||||||
void unsetPhoto_url();
|
void unsetMember_count();
|
||||||
void setPhotoUrl(const utility::string_t& value);
|
void setMemberCount(int32_t value);
|
||||||
|
|
||||||
int32_t getMemberCount() const;
|
std::shared_ptr<GroupRank> getRank() const;
|
||||||
bool memberCountIsSet() const;
|
bool rankIsSet() const;
|
||||||
void unsetMember_count();
|
void unsetRank();
|
||||||
void setMemberCount(int32_t value);
|
void setRank(const std::shared_ptr<GroupRank> &value);
|
||||||
|
|
||||||
std::shared_ptr<GroupRank> getRank() const;
|
utility::datetime getSince() const;
|
||||||
bool rankIsSet() const;
|
bool sinceIsSet() const;
|
||||||
void unsetRank();
|
void unsetSince();
|
||||||
void setRank(const std::shared_ptr<GroupRank>& value);
|
void setSince(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getSince() const;
|
protected:
|
||||||
bool sinceIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetSince();
|
bool m_IdIsSet;
|
||||||
void setSince(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Uuid;
|
||||||
|
bool m_UuidIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Name;
|
||||||
utility::string_t m_Id;
|
bool m_NameIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Uuid;
|
utility::string_t m_Tag;
|
||||||
bool m_UuidIsSet;
|
bool m_TagIsSet;
|
||||||
|
|
||||||
utility::string_t m_Name;
|
int32_t m_Privacy;
|
||||||
bool m_NameIsSet;
|
bool m_PrivacyIsSet;
|
||||||
|
|
||||||
utility::string_t m_Tag;
|
bool m_Verified;
|
||||||
bool m_TagIsSet;
|
bool m_VerifiedIsSet;
|
||||||
|
|
||||||
int32_t m_Privacy;
|
utility::string_t m_Photo_url;
|
||||||
bool m_PrivacyIsSet;
|
bool m_Photo_urlIsSet;
|
||||||
|
|
||||||
bool m_Verified;
|
int32_t m_Member_count;
|
||||||
bool m_VerifiedIsSet;
|
bool m_Member_countIsSet;
|
||||||
|
|
||||||
utility::string_t m_Photo_url;
|
std::shared_ptr<GroupRank> m_Rank;
|
||||||
bool m_Photo_urlIsSet;
|
bool m_RankIsSet;
|
||||||
|
|
||||||
int32_t m_Member_count;
|
utility::datetime m_Since;
|
||||||
bool m_Member_countIsSet;
|
bool m_SinceIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
std::shared_ptr<GroupRank> m_Rank;
|
}
|
||||||
bool m_RankIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Since;
|
|
||||||
bool m_SinceIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_ProfileGroup_H_ */
|
#endif /* TRIBUFU_MODELS_ProfileGroup_H_ */
|
||||||
|
@ -13,59 +13,54 @@
|
|||||||
/*
|
/*
|
||||||
* RefreshRequest.h
|
* RefreshRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_RefreshRequest_H_
|
#ifndef TRIBUFU_MODELS_RefreshRequest_H_
|
||||||
#define TRIBUFU_MODELS_RefreshRequest_H_
|
#define TRIBUFU_MODELS_RefreshRequest_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RefreshRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
RefreshRequest();
|
{
|
||||||
virtual ~RefreshRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class RefreshRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
RefreshRequest();
|
||||||
|
virtual ~RefreshRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// RefreshRequest members
|
/// RefreshRequest members
|
||||||
|
|
||||||
|
utility::string_t getRefreshToken() const;
|
||||||
|
bool refreshTokenIsSet() const;
|
||||||
|
void unsetRefresh_token();
|
||||||
|
void setRefreshToken(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getRefreshToken() const;
|
protected:
|
||||||
bool refreshTokenIsSet() const;
|
utility::string_t m_Refresh_token;
|
||||||
void unsetRefresh_token();
|
bool m_Refresh_tokenIsSet;
|
||||||
void setRefreshToken(const utility::string_t& value);
|
};
|
||||||
|
|
||||||
|
}
|
||||||
protected:
|
|
||||||
utility::string_t m_Refresh_token;
|
|
||||||
bool m_Refresh_tokenIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_RefreshRequest_H_ */
|
#endif /* TRIBUFU_MODELS_RefreshRequest_H_ */
|
||||||
|
@ -13,83 +13,78 @@
|
|||||||
/*
|
/*
|
||||||
* RegisterRequest.h
|
* RegisterRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_RegisterRequest_H_
|
#ifndef TRIBUFU_MODELS_RegisterRequest_H_
|
||||||
#define TRIBUFU_MODELS_RegisterRequest_H_
|
#define TRIBUFU_MODELS_RegisterRequest_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RegisterRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
RegisterRequest();
|
{
|
||||||
virtual ~RegisterRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class RegisterRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
RegisterRequest();
|
||||||
|
virtual ~RegisterRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// RegisterRequest members
|
/// RegisterRequest members
|
||||||
|
|
||||||
|
utility::string_t getUuid() const;
|
||||||
|
bool uuidIsSet() const;
|
||||||
|
void unsetUuid();
|
||||||
|
void setUuid(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUuid() const;
|
utility::string_t getName() const;
|
||||||
bool uuidIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetUuid();
|
void unsetName();
|
||||||
void setUuid(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getEmail() const;
|
||||||
bool nameIsSet() const;
|
bool emailIsSet() const;
|
||||||
void unsetName();
|
void unsetEmail();
|
||||||
void setName(const utility::string_t& value);
|
void setEmail(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getEmail() const;
|
utility::string_t getPassword() const;
|
||||||
bool emailIsSet() const;
|
bool passwordIsSet() const;
|
||||||
void unsetEmail();
|
void unsetPassword();
|
||||||
void setEmail(const utility::string_t& value);
|
void setPassword(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPassword() const;
|
protected:
|
||||||
bool passwordIsSet() const;
|
utility::string_t m_Uuid;
|
||||||
void unsetPassword();
|
bool m_UuidIsSet;
|
||||||
void setPassword(const utility::string_t& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Email;
|
||||||
utility::string_t m_Uuid;
|
bool m_EmailIsSet;
|
||||||
bool m_UuidIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Password;
|
||||||
bool m_NameIsSet;
|
bool m_PasswordIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::string_t m_Email;
|
}
|
||||||
bool m_EmailIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Password;
|
|
||||||
bool m_PasswordIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_RegisterRequest_H_ */
|
#endif /* TRIBUFU_MODELS_RegisterRequest_H_ */
|
||||||
|
@ -13,52 +13,52 @@
|
|||||||
/*
|
/*
|
||||||
* ResponseType.h
|
* ResponseType.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_ResponseType_H_
|
#ifndef TRIBUFU_MODELS_ResponseType_H_
|
||||||
#define TRIBUFU_MODELS_ResponseType_H_
|
#define TRIBUFU_MODELS_ResponseType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class ResponseType
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
ResponseType();
|
|
||||||
virtual ~ResponseType();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eResponseType
|
|
||||||
{
|
{
|
||||||
ResponseType_CODE,
|
|
||||||
ResponseType_TOKEN,
|
|
||||||
};
|
|
||||||
|
|
||||||
eResponseType getValue() const;
|
class ResponseType : public ModelBase
|
||||||
void setValue(eResponseType const value);
|
{
|
||||||
|
public:
|
||||||
|
ResponseType();
|
||||||
|
virtual ~ResponseType();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eResponseType m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eResponseType
|
||||||
|
{
|
||||||
|
ResponseType_CODE,
|
||||||
|
ResponseType_TOKEN,
|
||||||
|
};
|
||||||
|
|
||||||
|
eResponseType getValue() const;
|
||||||
|
void setValue(eResponseType const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eResponseType m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_ResponseType_H_ */
|
#endif /* TRIBUFU_MODELS_ResponseType_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* RevokeRequest.h
|
* RevokeRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_RevokeRequest_H_
|
#ifndef TRIBUFU_MODELS_RevokeRequest_H_
|
||||||
@ -23,59 +23,55 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/TokenHintType.h"
|
#include "tribufu++/model/TokenHintType.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RevokeRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
RevokeRequest();
|
{
|
||||||
virtual ~RevokeRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class RevokeRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
RevokeRequest();
|
||||||
|
virtual ~RevokeRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// RevokeRequest members
|
/// RevokeRequest members
|
||||||
|
|
||||||
|
utility::string_t getToken() const;
|
||||||
|
bool tokenIsSet() const;
|
||||||
|
void unsetToken();
|
||||||
|
void setToken(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getToken() const;
|
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
||||||
bool tokenIsSet() const;
|
bool tokenTypeHintIsSet() const;
|
||||||
void unsetToken();
|
void unsetToken_type_hint();
|
||||||
void setToken(const utility::string_t& value);
|
void setTokenTypeHint(const std::shared_ptr<TokenHintType> &value);
|
||||||
|
|
||||||
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
protected:
|
||||||
bool tokenTypeHintIsSet() const;
|
utility::string_t m_Token;
|
||||||
void unsetToken_type_hint();
|
bool m_TokenIsSet;
|
||||||
void setTokenTypeHint(const std::shared_ptr<TokenHintType>& value);
|
|
||||||
|
|
||||||
|
std::shared_ptr<TokenHintType> m_Token_type_hint;
|
||||||
|
bool m_Token_type_hintIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
}
|
||||||
utility::string_t m_Token;
|
|
||||||
bool m_TokenIsSet;
|
|
||||||
|
|
||||||
std::shared_ptr<TokenHintType> m_Token_type_hint;
|
|
||||||
bool m_Token_type_hintIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_RevokeRequest_H_ */
|
#endif /* TRIBUFU_MODELS_RevokeRequest_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* SearchRequest.h
|
* SearchRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_SearchRequest_H_
|
#ifndef TRIBUFU_MODELS_SearchRequest_H_
|
||||||
@ -26,72 +26,68 @@
|
|||||||
#include "tribufu++/model/SearchType.h"
|
#include "tribufu++/model/SearchType.h"
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SearchRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
SearchRequest();
|
{
|
||||||
virtual ~SearchRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class SearchRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
SearchRequest();
|
||||||
|
virtual ~SearchRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// SearchRequest members
|
/// SearchRequest members
|
||||||
|
|
||||||
|
std::shared_ptr<SearchType> getType() const;
|
||||||
|
bool typeIsSet() const;
|
||||||
|
void unsetType();
|
||||||
|
void setType(const std::shared_ptr<SearchType> &value);
|
||||||
|
|
||||||
std::shared_ptr<SearchType> getType() const;
|
utility::string_t getQuery() const;
|
||||||
bool typeIsSet() const;
|
bool queryIsSet() const;
|
||||||
void unsetType();
|
void unsetQuery();
|
||||||
void setType(const std::shared_ptr<SearchType>& value);
|
void setQuery(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getQuery() const;
|
int32_t getPage() const;
|
||||||
bool queryIsSet() const;
|
bool pageIsSet() const;
|
||||||
void unsetQuery();
|
void unsetPage();
|
||||||
void setQuery(const utility::string_t& value);
|
void setPage(int32_t value);
|
||||||
|
|
||||||
int32_t getPage() const;
|
utility::string_t getGameId() const;
|
||||||
bool pageIsSet() const;
|
bool gameIdIsSet() const;
|
||||||
void unsetPage();
|
void unsetGame_id();
|
||||||
void setPage(int32_t value);
|
void setGameId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getGameId() const;
|
protected:
|
||||||
bool gameIdIsSet() const;
|
std::shared_ptr<SearchType> m_Type;
|
||||||
void unsetGame_id();
|
bool m_TypeIsSet;
|
||||||
void setGameId(const utility::string_t& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Query;
|
||||||
|
bool m_QueryIsSet;
|
||||||
|
|
||||||
protected:
|
int32_t m_Page;
|
||||||
std::shared_ptr<SearchType> m_Type;
|
bool m_PageIsSet;
|
||||||
bool m_TypeIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Query;
|
utility::string_t m_Game_id;
|
||||||
bool m_QueryIsSet;
|
bool m_Game_idIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
int32_t m_Page;
|
}
|
||||||
bool m_PageIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Game_id;
|
|
||||||
bool m_Game_idIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_SearchRequest_H_ */
|
#endif /* TRIBUFU_MODELS_SearchRequest_H_ */
|
||||||
|
@ -13,54 +13,54 @@
|
|||||||
/*
|
/*
|
||||||
* SearchType.h
|
* SearchType.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_SearchType_H_
|
#ifndef TRIBUFU_MODELS_SearchType_H_
|
||||||
#define TRIBUFU_MODELS_SearchType_H_
|
#define TRIBUFU_MODELS_SearchType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class SearchType
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
SearchType();
|
|
||||||
virtual ~SearchType();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eSearchType
|
|
||||||
{
|
{
|
||||||
SearchType_USER,
|
|
||||||
SearchType_GROUP,
|
|
||||||
SearchType_SERVER,
|
|
||||||
SearchType_CLUSTER,
|
|
||||||
};
|
|
||||||
|
|
||||||
eSearchType getValue() const;
|
class SearchType : public ModelBase
|
||||||
void setValue(eSearchType const value);
|
{
|
||||||
|
public:
|
||||||
|
SearchType();
|
||||||
|
virtual ~SearchType();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eSearchType m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eSearchType
|
||||||
|
{
|
||||||
|
SearchType_USER,
|
||||||
|
SearchType_GROUP,
|
||||||
|
SearchType_SERVER,
|
||||||
|
SearchType_CLUSTER,
|
||||||
|
};
|
||||||
|
|
||||||
|
eSearchType getValue() const;
|
||||||
|
void setValue(eSearchType const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eSearchType m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_SearchType_H_ */
|
#endif /* TRIBUFU_MODELS_SearchType_H_ */
|
||||||
|
@ -13,74 +13,68 @@
|
|||||||
/*
|
/*
|
||||||
* ServerMetrics.h
|
* ServerMetrics.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_ServerMetrics_H_
|
#ifndef TRIBUFU_MODELS_ServerMetrics_H_
|
||||||
#define TRIBUFU_MODELS_ServerMetrics_H_
|
#define TRIBUFU_MODELS_ServerMetrics_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ServerMetrics
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
ServerMetrics();
|
{
|
||||||
virtual ~ServerMetrics();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class ServerMetrics : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
ServerMetrics();
|
||||||
|
virtual ~ServerMetrics();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// ServerMetrics members
|
/// ServerMetrics members
|
||||||
|
|
||||||
|
int32_t getServerCount() const;
|
||||||
|
bool serverCountIsSet() const;
|
||||||
|
void unsetServer_count();
|
||||||
|
void setServerCount(int32_t value);
|
||||||
|
|
||||||
int32_t getServerCount() const;
|
int32_t getPackageCount() const;
|
||||||
bool serverCountIsSet() const;
|
bool packageCountIsSet() const;
|
||||||
void unsetServer_count();
|
void unsetPackage_count();
|
||||||
void setServerCount(int32_t value);
|
void setPackageCount(int32_t value);
|
||||||
|
|
||||||
int32_t getPackageCount() const;
|
int32_t getCountryCount() const;
|
||||||
bool packageCountIsSet() const;
|
bool countryCountIsSet() const;
|
||||||
void unsetPackage_count();
|
void unsetCountry_count();
|
||||||
void setPackageCount(int32_t value);
|
void setCountryCount(int32_t value);
|
||||||
|
|
||||||
int32_t getCountryCount() const;
|
protected:
|
||||||
bool countryCountIsSet() const;
|
int32_t m_Server_count;
|
||||||
void unsetCountry_count();
|
bool m_Server_countIsSet;
|
||||||
void setCountryCount(int32_t value);
|
|
||||||
|
|
||||||
|
int32_t m_Package_count;
|
||||||
|
bool m_Package_countIsSet;
|
||||||
|
|
||||||
protected:
|
int32_t m_Country_count;
|
||||||
int32_t m_Server_count;
|
bool m_Country_countIsSet;
|
||||||
bool m_Server_countIsSet;
|
};
|
||||||
|
|
||||||
int32_t m_Package_count;
|
}
|
||||||
bool m_Package_countIsSet;
|
|
||||||
|
|
||||||
int32_t m_Country_count;
|
|
||||||
bool m_Country_countIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_ServerMetrics_H_ */
|
#endif /* TRIBUFU_MODELS_ServerMetrics_H_ */
|
||||||
|
@ -13,53 +13,53 @@
|
|||||||
/*
|
/*
|
||||||
* ServerStatus.h
|
* ServerStatus.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_ServerStatus_H_
|
#ifndef TRIBUFU_MODELS_ServerStatus_H_
|
||||||
#define TRIBUFU_MODELS_ServerStatus_H_
|
#define TRIBUFU_MODELS_ServerStatus_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class ServerStatus
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
ServerStatus();
|
|
||||||
virtual ~ServerStatus();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eServerStatus
|
|
||||||
{
|
{
|
||||||
ServerStatus_UNKNOWN,
|
|
||||||
ServerStatus_OFFLINE,
|
|
||||||
ServerStatus_ONLINE,
|
|
||||||
};
|
|
||||||
|
|
||||||
eServerStatus getValue() const;
|
class ServerStatus : public ModelBase
|
||||||
void setValue(eServerStatus const value);
|
{
|
||||||
|
public:
|
||||||
|
ServerStatus();
|
||||||
|
virtual ~ServerStatus();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eServerStatus m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eServerStatus
|
||||||
|
{
|
||||||
|
ServerStatus_UNKNOWN,
|
||||||
|
ServerStatus_OFFLINE,
|
||||||
|
ServerStatus_ONLINE,
|
||||||
|
};
|
||||||
|
|
||||||
|
eServerStatus getValue() const;
|
||||||
|
void setValue(eServerStatus const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eServerStatus m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_ServerStatus_H_ */
|
#endif /* TRIBUFU_MODELS_ServerStatus_H_ */
|
||||||
|
@ -13,108 +13,103 @@
|
|||||||
/*
|
/*
|
||||||
* Subscription.h
|
* Subscription.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_Subscription_H_
|
#ifndef TRIBUFU_MODELS_Subscription_H_
|
||||||
#define TRIBUFU_MODELS_Subscription_H_
|
#define TRIBUFU_MODELS_Subscription_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Subscription
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
Subscription();
|
{
|
||||||
virtual ~Subscription();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class Subscription : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
Subscription();
|
||||||
|
virtual ~Subscription();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// Subscription members
|
/// Subscription members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getName() const;
|
||||||
bool idIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetId();
|
void unsetName();
|
||||||
void setId(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDescription() const;
|
||||||
bool nameIsSet() const;
|
bool descriptionIsSet() const;
|
||||||
void unsetName();
|
void unsetDescription();
|
||||||
void setName(const utility::string_t& value);
|
void setDescription(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDescription() const;
|
utility::string_t getImageUrl() const;
|
||||||
bool descriptionIsSet() const;
|
bool imageUrlIsSet() const;
|
||||||
void unsetDescription();
|
void unsetImage_url();
|
||||||
void setDescription(const utility::string_t& value);
|
void setImageUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getImageUrl() const;
|
std::map<utility::string_t, double> getPrices() const;
|
||||||
bool imageUrlIsSet() const;
|
bool pricesIsSet() const;
|
||||||
void unsetImage_url();
|
void unsetPrices();
|
||||||
void setImageUrl(const utility::string_t& value);
|
void setPrices(std::map<utility::string_t, double> value);
|
||||||
|
|
||||||
std::map<utility::string_t, double> getPrices() const;
|
utility::datetime getCreated() const;
|
||||||
bool pricesIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetPrices();
|
void unsetCreated();
|
||||||
void setPrices(std::map<utility::string_t, double> value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Name;
|
||||||
|
bool m_NameIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Description;
|
||||||
utility::string_t m_Id;
|
bool m_DescriptionIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Image_url;
|
||||||
bool m_NameIsSet;
|
bool m_Image_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Description;
|
std::map<utility::string_t, double> m_Prices;
|
||||||
bool m_DescriptionIsSet;
|
bool m_PricesIsSet;
|
||||||
|
|
||||||
utility::string_t m_Image_url;
|
utility::datetime m_Created;
|
||||||
bool m_Image_urlIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
std::map<utility::string_t, double> m_Prices;
|
utility::datetime m_Updated;
|
||||||
bool m_PricesIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_Subscription_H_ */
|
#endif /* TRIBUFU_MODELS_Subscription_H_ */
|
||||||
|
@ -13,52 +13,52 @@
|
|||||||
/*
|
/*
|
||||||
* TokenHintType.h
|
* TokenHintType.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_TokenHintType_H_
|
#ifndef TRIBUFU_MODELS_TokenHintType_H_
|
||||||
#define TRIBUFU_MODELS_TokenHintType_H_
|
#define TRIBUFU_MODELS_TokenHintType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class TokenHintType
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
TokenHintType();
|
|
||||||
virtual ~TokenHintType();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eTokenHintType
|
|
||||||
{
|
{
|
||||||
TokenHintType_ACCESS_TOKEN,
|
|
||||||
TokenHintType_REFRESH_TOKEN,
|
|
||||||
};
|
|
||||||
|
|
||||||
eTokenHintType getValue() const;
|
class TokenHintType : public ModelBase
|
||||||
void setValue(eTokenHintType const value);
|
{
|
||||||
|
public:
|
||||||
|
TokenHintType();
|
||||||
|
virtual ~TokenHintType();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eTokenHintType m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eTokenHintType
|
||||||
|
{
|
||||||
|
TokenHintType_ACCESS_TOKEN,
|
||||||
|
TokenHintType_REFRESH_TOKEN,
|
||||||
|
};
|
||||||
|
|
||||||
|
eTokenHintType getValue() const;
|
||||||
|
void setValue(eTokenHintType const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eTokenHintType m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_TokenHintType_H_ */
|
#endif /* TRIBUFU_MODELS_TokenHintType_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* TokenRequest.h
|
* TokenRequest.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_TokenRequest_H_
|
#ifndef TRIBUFU_MODELS_TokenRequest_H_
|
||||||
@ -23,107 +23,103 @@
|
|||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
|
||||||
#include "tribufu++/model/GrantType.h"
|
#include "tribufu++/model/GrantType.h"
|
||||||
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TokenRequest
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
TokenRequest();
|
{
|
||||||
virtual ~TokenRequest();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class TokenRequest : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
TokenRequest();
|
||||||
|
virtual ~TokenRequest();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// TokenRequest members
|
/// TokenRequest members
|
||||||
|
|
||||||
|
std::shared_ptr<GrantType> getGrantType() const;
|
||||||
|
bool grantTypeIsSet() const;
|
||||||
|
void unsetGrant_type();
|
||||||
|
void setGrantType(const std::shared_ptr<GrantType> &value);
|
||||||
|
|
||||||
std::shared_ptr<GrantType> getGrantType() const;
|
utility::string_t getCode() const;
|
||||||
bool grantTypeIsSet() const;
|
bool codeIsSet() const;
|
||||||
void unsetGrant_type();
|
void unsetCode();
|
||||||
void setGrantType(const std::shared_ptr<GrantType>& value);
|
void setCode(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCode() const;
|
utility::string_t getUsername() const;
|
||||||
bool codeIsSet() const;
|
bool usernameIsSet() const;
|
||||||
void unsetCode();
|
void unsetUsername();
|
||||||
void setCode(const utility::string_t& value);
|
void setUsername(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUsername() const;
|
utility::string_t getPassword() const;
|
||||||
bool usernameIsSet() const;
|
bool passwordIsSet() const;
|
||||||
void unsetUsername();
|
void unsetPassword();
|
||||||
void setUsername(const utility::string_t& value);
|
void setPassword(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPassword() const;
|
utility::string_t getRefreshToken() const;
|
||||||
bool passwordIsSet() const;
|
bool refreshTokenIsSet() const;
|
||||||
void unsetPassword();
|
void unsetRefresh_token();
|
||||||
void setPassword(const utility::string_t& value);
|
void setRefreshToken(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getRefreshToken() const;
|
utility::string_t getClientId() const;
|
||||||
bool refreshTokenIsSet() const;
|
bool clientIdIsSet() const;
|
||||||
void unsetRefresh_token();
|
void unsetClient_id();
|
||||||
void setRefreshToken(const utility::string_t& value);
|
void setClientId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getClientId() const;
|
utility::string_t getRedirectUri() const;
|
||||||
bool clientIdIsSet() const;
|
bool redirectUriIsSet() const;
|
||||||
void unsetClient_id();
|
void unsetRedirect_uri();
|
||||||
void setClientId(const utility::string_t& value);
|
void setRedirectUri(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getRedirectUri() const;
|
utility::string_t getCodeVerifier() const;
|
||||||
bool redirectUriIsSet() const;
|
bool codeVerifierIsSet() const;
|
||||||
void unsetRedirect_uri();
|
void unsetCode_verifier();
|
||||||
void setRedirectUri(const utility::string_t& value);
|
void setCodeVerifier(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCodeVerifier() const;
|
protected:
|
||||||
bool codeVerifierIsSet() const;
|
std::shared_ptr<GrantType> m_Grant_type;
|
||||||
void unsetCode_verifier();
|
bool m_Grant_typeIsSet;
|
||||||
void setCodeVerifier(const utility::string_t& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Code;
|
||||||
|
bool m_CodeIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Username;
|
||||||
std::shared_ptr<GrantType> m_Grant_type;
|
bool m_UsernameIsSet;
|
||||||
bool m_Grant_typeIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Code;
|
utility::string_t m_Password;
|
||||||
bool m_CodeIsSet;
|
bool m_PasswordIsSet;
|
||||||
|
|
||||||
utility::string_t m_Username;
|
utility::string_t m_Refresh_token;
|
||||||
bool m_UsernameIsSet;
|
bool m_Refresh_tokenIsSet;
|
||||||
|
|
||||||
utility::string_t m_Password;
|
utility::string_t m_Client_id;
|
||||||
bool m_PasswordIsSet;
|
bool m_Client_idIsSet;
|
||||||
|
|
||||||
utility::string_t m_Refresh_token;
|
utility::string_t m_Redirect_uri;
|
||||||
bool m_Refresh_tokenIsSet;
|
bool m_Redirect_uriIsSet;
|
||||||
|
|
||||||
utility::string_t m_Client_id;
|
utility::string_t m_Code_verifier;
|
||||||
bool m_Client_idIsSet;
|
bool m_Code_verifierIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::string_t m_Redirect_uri;
|
}
|
||||||
bool m_Redirect_uriIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Code_verifier;
|
|
||||||
bool m_Code_verifierIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_TokenRequest_H_ */
|
#endif /* TRIBUFU_MODELS_TokenRequest_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* TokenResponse.h
|
* TokenResponse.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_TokenResponse_H_
|
#ifndef TRIBUFU_MODELS_TokenResponse_H_
|
||||||
@ -26,88 +26,84 @@
|
|||||||
#include "tribufu++/model/TokenType.h"
|
#include "tribufu++/model/TokenType.h"
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TokenResponse
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
TokenResponse();
|
{
|
||||||
virtual ~TokenResponse();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class TokenResponse : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
TokenResponse();
|
||||||
|
virtual ~TokenResponse();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// TokenResponse members
|
/// TokenResponse members
|
||||||
|
|
||||||
|
std::shared_ptr<TokenType> getTokenType() const;
|
||||||
|
bool tokenTypeIsSet() const;
|
||||||
|
void unsetToken_type();
|
||||||
|
void setTokenType(const std::shared_ptr<TokenType> &value);
|
||||||
|
|
||||||
std::shared_ptr<TokenType> getTokenType() const;
|
utility::string_t getAccessToken() const;
|
||||||
bool tokenTypeIsSet() const;
|
bool accessTokenIsSet() const;
|
||||||
void unsetToken_type();
|
void unsetAccess_token();
|
||||||
void setTokenType(const std::shared_ptr<TokenType>& value);
|
void setAccessToken(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getAccessToken() const;
|
utility::string_t getRefreshToken() const;
|
||||||
bool accessTokenIsSet() const;
|
bool refreshTokenIsSet() const;
|
||||||
void unsetAccess_token();
|
void unsetRefresh_token();
|
||||||
void setAccessToken(const utility::string_t& value);
|
void setRefreshToken(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getRefreshToken() const;
|
utility::string_t getScope() const;
|
||||||
bool refreshTokenIsSet() const;
|
bool scopeIsSet() const;
|
||||||
void unsetRefresh_token();
|
void unsetScope();
|
||||||
void setRefreshToken(const utility::string_t& value);
|
void setScope(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getScope() const;
|
utility::string_t getState() const;
|
||||||
bool scopeIsSet() const;
|
bool stateIsSet() const;
|
||||||
void unsetScope();
|
void unsetState();
|
||||||
void setScope(const utility::string_t& value);
|
void setState(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getState() const;
|
int64_t getExpiresIn() const;
|
||||||
bool stateIsSet() const;
|
bool expiresInIsSet() const;
|
||||||
void unsetState();
|
void unsetExpires_in();
|
||||||
void setState(const utility::string_t& value);
|
void setExpiresIn(int64_t value);
|
||||||
|
|
||||||
int64_t getExpiresIn() const;
|
protected:
|
||||||
bool expiresInIsSet() const;
|
std::shared_ptr<TokenType> m_Token_type;
|
||||||
void unsetExpires_in();
|
bool m_Token_typeIsSet;
|
||||||
void setExpiresIn(int64_t value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Access_token;
|
||||||
|
bool m_Access_tokenIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Refresh_token;
|
||||||
std::shared_ptr<TokenType> m_Token_type;
|
bool m_Refresh_tokenIsSet;
|
||||||
bool m_Token_typeIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Access_token;
|
utility::string_t m_Scope;
|
||||||
bool m_Access_tokenIsSet;
|
bool m_ScopeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Refresh_token;
|
utility::string_t m_State;
|
||||||
bool m_Refresh_tokenIsSet;
|
bool m_StateIsSet;
|
||||||
|
|
||||||
utility::string_t m_Scope;
|
int64_t m_Expires_in;
|
||||||
bool m_ScopeIsSet;
|
bool m_Expires_inIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::string_t m_State;
|
}
|
||||||
bool m_StateIsSet;
|
|
||||||
|
|
||||||
int64_t m_Expires_in;
|
|
||||||
bool m_Expires_inIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_TokenResponse_H_ */
|
#endif /* TRIBUFU_MODELS_TokenResponse_H_ */
|
||||||
|
@ -13,51 +13,51 @@
|
|||||||
/*
|
/*
|
||||||
* TokenType.h
|
* TokenType.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_TokenType_H_
|
#ifndef TRIBUFU_MODELS_TokenType_H_
|
||||||
#define TRIBUFU_MODELS_TokenType_H_
|
#define TRIBUFU_MODELS_TokenType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class TokenType
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
TokenType();
|
|
||||||
virtual ~TokenType();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eTokenType
|
|
||||||
{
|
{
|
||||||
TokenType_BEARER,
|
|
||||||
};
|
|
||||||
|
|
||||||
eTokenType getValue() const;
|
class TokenType : public ModelBase
|
||||||
void setValue(eTokenType const value);
|
{
|
||||||
|
public:
|
||||||
|
TokenType();
|
||||||
|
virtual ~TokenType();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eTokenType m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eTokenType
|
||||||
|
{
|
||||||
|
TokenType_BEARER,
|
||||||
|
};
|
||||||
|
|
||||||
|
eTokenType getValue() const;
|
||||||
|
void setValue(eTokenType const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eTokenType m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_TokenType_H_ */
|
#endif /* TRIBUFU_MODELS_TokenType_H_ */
|
||||||
|
@ -13,67 +13,62 @@
|
|||||||
/*
|
/*
|
||||||
* UpdateProfile.h
|
* UpdateProfile.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_UpdateProfile_H_
|
#ifndef TRIBUFU_MODELS_UpdateProfile_H_
|
||||||
#define TRIBUFU_MODELS_UpdateProfile_H_
|
#define TRIBUFU_MODELS_UpdateProfile_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class UpdateProfile
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
UpdateProfile();
|
{
|
||||||
virtual ~UpdateProfile();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class UpdateProfile : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
UpdateProfile();
|
||||||
|
virtual ~UpdateProfile();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// UpdateProfile members
|
/// UpdateProfile members
|
||||||
|
|
||||||
|
utility::string_t getDisplayName() const;
|
||||||
|
bool displayNameIsSet() const;
|
||||||
|
void unsetDisplay_name();
|
||||||
|
void setDisplayName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDisplayName() const;
|
utility::string_t getBiography() const;
|
||||||
bool displayNameIsSet() const;
|
bool biographyIsSet() const;
|
||||||
void unsetDisplay_name();
|
void unsetBiography();
|
||||||
void setDisplayName(const utility::string_t& value);
|
void setBiography(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBiography() const;
|
protected:
|
||||||
bool biographyIsSet() const;
|
utility::string_t m_Display_name;
|
||||||
void unsetBiography();
|
bool m_Display_nameIsSet;
|
||||||
void setBiography(const utility::string_t& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Biography;
|
||||||
|
bool m_BiographyIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
}
|
||||||
utility::string_t m_Display_name;
|
|
||||||
bool m_Display_nameIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Biography;
|
|
||||||
bool m_BiographyIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_UpdateProfile_H_ */
|
#endif /* TRIBUFU_MODELS_UpdateProfile_H_ */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/*
|
/*
|
||||||
* UserInfo.h
|
* UserInfo.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_UserInfo_H_
|
#ifndef TRIBUFU_MODELS_UserInfo_H_
|
||||||
@ -26,240 +26,236 @@
|
|||||||
#include "tribufu++/model/UserType.h"
|
#include "tribufu++/model/UserType.h"
|
||||||
#include <cpprest/details/basic_types.h>
|
#include <cpprest/details/basic_types.h>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class UserInfo
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
UserInfo();
|
{
|
||||||
virtual ~UserInfo();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
class UserInfo : public ModelBase
|
||||||
/// ModelBase overrides
|
{
|
||||||
|
public:
|
||||||
|
UserInfo();
|
||||||
|
virtual ~UserInfo();
|
||||||
|
|
||||||
void validate() override;
|
/////////////////////////////////////////////
|
||||||
|
/// ModelBase overrides
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
void validate() override;
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
web::json::value toJson() const override;
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
/// UserInfo members
|
/// UserInfo members
|
||||||
|
|
||||||
|
utility::string_t getId() const;
|
||||||
|
bool idIsSet() const;
|
||||||
|
void unsetId();
|
||||||
|
void setId(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getId() const;
|
utility::string_t getUuid() const;
|
||||||
bool idIsSet() const;
|
bool uuidIsSet() const;
|
||||||
void unsetId();
|
void unsetUuid();
|
||||||
void setId(const utility::string_t& value);
|
void setUuid(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getUuid() const;
|
utility::string_t getName() const;
|
||||||
bool uuidIsSet() const;
|
bool nameIsSet() const;
|
||||||
void unsetUuid();
|
void unsetName();
|
||||||
void setUuid(const utility::string_t& value);
|
void setName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getName() const;
|
utility::string_t getDisplayName() const;
|
||||||
bool nameIsSet() const;
|
bool displayNameIsSet() const;
|
||||||
void unsetName();
|
void unsetDisplay_name();
|
||||||
void setName(const utility::string_t& value);
|
void setDisplayName(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getDisplayName() const;
|
utility::string_t getEmail() const;
|
||||||
bool displayNameIsSet() const;
|
bool emailIsSet() const;
|
||||||
void unsetDisplay_name();
|
void unsetEmail();
|
||||||
void setDisplayName(const utility::string_t& value);
|
void setEmail(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getEmail() const;
|
std::shared_ptr<UserType> getType() const;
|
||||||
bool emailIsSet() const;
|
bool typeIsSet() const;
|
||||||
void unsetEmail();
|
void unsetType();
|
||||||
void setEmail(const utility::string_t& value);
|
void setType(const std::shared_ptr<UserType> &value);
|
||||||
|
|
||||||
std::shared_ptr<UserType> getType() const;
|
utility::string_t getFlags() const;
|
||||||
bool typeIsSet() const;
|
bool flagsIsSet() const;
|
||||||
void unsetType();
|
void unsetFlags();
|
||||||
void setType(const std::shared_ptr<UserType>& value);
|
void setFlags(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getFlags() const;
|
utility::string_t getPermissions() const;
|
||||||
bool flagsIsSet() const;
|
bool permissionsIsSet() const;
|
||||||
void unsetFlags();
|
void unsetPermissions();
|
||||||
void setFlags(const utility::string_t& value);
|
void setPermissions(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPermissions() const;
|
bool isVerified() const;
|
||||||
bool permissionsIsSet() const;
|
bool verifiedIsSet() const;
|
||||||
void unsetPermissions();
|
void unsetVerified();
|
||||||
void setPermissions(const utility::string_t& value);
|
void setVerified(bool value);
|
||||||
|
|
||||||
bool isVerified() const;
|
int32_t getLevel() const;
|
||||||
bool verifiedIsSet() const;
|
bool levelIsSet() const;
|
||||||
void unsetVerified();
|
void unsetLevel();
|
||||||
void setVerified(bool value);
|
void setLevel(int32_t value);
|
||||||
|
|
||||||
int32_t getLevel() const;
|
double getExperience() const;
|
||||||
bool levelIsSet() const;
|
bool experienceIsSet() const;
|
||||||
void unsetLevel();
|
void unsetExperience();
|
||||||
void setLevel(int32_t value);
|
void setExperience(double value);
|
||||||
|
|
||||||
double getExperience() const;
|
bool isPublicBirthday() const;
|
||||||
bool experienceIsSet() const;
|
bool publicBirthdayIsSet() const;
|
||||||
void unsetExperience();
|
void unsetPublic_birthday();
|
||||||
void setExperience(double value);
|
void setPublicBirthday(bool value);
|
||||||
|
|
||||||
bool isPublicBirthday() const;
|
utility::datetime getBirthday() const;
|
||||||
bool publicBirthdayIsSet() const;
|
bool birthdayIsSet() const;
|
||||||
void unsetPublic_birthday();
|
void unsetBirthday();
|
||||||
void setPublicBirthday(bool value);
|
void setBirthday(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getBirthday() const;
|
double getPoints() const;
|
||||||
bool birthdayIsSet() const;
|
bool pointsIsSet() const;
|
||||||
void unsetBirthday();
|
void unsetPoints();
|
||||||
void setBirthday(const utility::datetime& value);
|
void setPoints(double value);
|
||||||
|
|
||||||
double getPoints() const;
|
utility::string_t getLocation() const;
|
||||||
bool pointsIsSet() const;
|
bool locationIsSet() const;
|
||||||
void unsetPoints();
|
void unsetLocation();
|
||||||
void setPoints(double value);
|
void setLocation(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLocation() const;
|
utility::string_t getLanguage() const;
|
||||||
bool locationIsSet() const;
|
bool languageIsSet() const;
|
||||||
void unsetLocation();
|
void unsetLanguage();
|
||||||
void setLocation(const utility::string_t& value);
|
void setLanguage(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getLanguage() const;
|
utility::string_t getTimezone() const;
|
||||||
bool languageIsSet() const;
|
bool timezoneIsSet() const;
|
||||||
void unsetLanguage();
|
void unsetTimezone();
|
||||||
void setLanguage(const utility::string_t& value);
|
void setTimezone(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getTimezone() const;
|
utility::string_t getCurrency() const;
|
||||||
bool timezoneIsSet() const;
|
bool currencyIsSet() const;
|
||||||
void unsetTimezone();
|
void unsetCurrency();
|
||||||
void setTimezone(const utility::string_t& value);
|
void setCurrency(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getCurrency() const;
|
utility::string_t getPhotoUrl() const;
|
||||||
bool currencyIsSet() const;
|
bool photoUrlIsSet() const;
|
||||||
void unsetCurrency();
|
void unsetPhoto_url();
|
||||||
void setCurrency(const utility::string_t& value);
|
void setPhotoUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getPhotoUrl() const;
|
utility::string_t getBannerUrl() const;
|
||||||
bool photoUrlIsSet() const;
|
bool bannerUrlIsSet() const;
|
||||||
void unsetPhoto_url();
|
void unsetBanner_url();
|
||||||
void setPhotoUrl(const utility::string_t& value);
|
void setBannerUrl(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBannerUrl() const;
|
utility::datetime getLastOnline() const;
|
||||||
bool bannerUrlIsSet() const;
|
bool lastOnlineIsSet() const;
|
||||||
void unsetBanner_url();
|
void unsetLast_online();
|
||||||
void setBannerUrl(const utility::string_t& value);
|
void setLastOnline(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getLastOnline() const;
|
utility::string_t getBiography() const;
|
||||||
bool lastOnlineIsSet() const;
|
bool biographyIsSet() const;
|
||||||
void unsetLast_online();
|
void unsetBiography();
|
||||||
void setLastOnline(const utility::datetime& value);
|
void setBiography(const utility::string_t &value);
|
||||||
|
|
||||||
utility::string_t getBiography() const;
|
int32_t getViewCount() const;
|
||||||
bool biographyIsSet() const;
|
bool viewCountIsSet() const;
|
||||||
void unsetBiography();
|
void unsetView_count();
|
||||||
void setBiography(const utility::string_t& value);
|
void setViewCount(int32_t value);
|
||||||
|
|
||||||
int32_t getViewCount() const;
|
utility::datetime getCreated() const;
|
||||||
bool viewCountIsSet() const;
|
bool createdIsSet() const;
|
||||||
void unsetView_count();
|
void unsetCreated();
|
||||||
void setViewCount(int32_t value);
|
void setCreated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getCreated() const;
|
utility::datetime getUpdated() const;
|
||||||
bool createdIsSet() const;
|
bool updatedIsSet() const;
|
||||||
void unsetCreated();
|
void unsetUpdated();
|
||||||
void setCreated(const utility::datetime& value);
|
void setUpdated(const utility::datetime &value);
|
||||||
|
|
||||||
utility::datetime getUpdated() const;
|
protected:
|
||||||
bool updatedIsSet() const;
|
utility::string_t m_Id;
|
||||||
void unsetUpdated();
|
bool m_IdIsSet;
|
||||||
void setUpdated(const utility::datetime& value);
|
|
||||||
|
|
||||||
|
utility::string_t m_Uuid;
|
||||||
|
bool m_UuidIsSet;
|
||||||
|
|
||||||
protected:
|
utility::string_t m_Name;
|
||||||
utility::string_t m_Id;
|
bool m_NameIsSet;
|
||||||
bool m_IdIsSet;
|
|
||||||
|
|
||||||
utility::string_t m_Uuid;
|
utility::string_t m_Display_name;
|
||||||
bool m_UuidIsSet;
|
bool m_Display_nameIsSet;
|
||||||
|
|
||||||
utility::string_t m_Name;
|
utility::string_t m_Email;
|
||||||
bool m_NameIsSet;
|
bool m_EmailIsSet;
|
||||||
|
|
||||||
utility::string_t m_Display_name;
|
std::shared_ptr<UserType> m_Type;
|
||||||
bool m_Display_nameIsSet;
|
bool m_TypeIsSet;
|
||||||
|
|
||||||
utility::string_t m_Email;
|
utility::string_t m_Flags;
|
||||||
bool m_EmailIsSet;
|
bool m_FlagsIsSet;
|
||||||
|
|
||||||
std::shared_ptr<UserType> m_Type;
|
utility::string_t m_Permissions;
|
||||||
bool m_TypeIsSet;
|
bool m_PermissionsIsSet;
|
||||||
|
|
||||||
utility::string_t m_Flags;
|
bool m_Verified;
|
||||||
bool m_FlagsIsSet;
|
bool m_VerifiedIsSet;
|
||||||
|
|
||||||
utility::string_t m_Permissions;
|
int32_t m_Level;
|
||||||
bool m_PermissionsIsSet;
|
bool m_LevelIsSet;
|
||||||
|
|
||||||
bool m_Verified;
|
double m_Experience;
|
||||||
bool m_VerifiedIsSet;
|
bool m_ExperienceIsSet;
|
||||||
|
|
||||||
int32_t m_Level;
|
bool m_Public_birthday;
|
||||||
bool m_LevelIsSet;
|
bool m_Public_birthdayIsSet;
|
||||||
|
|
||||||
double m_Experience;
|
utility::datetime m_Birthday;
|
||||||
bool m_ExperienceIsSet;
|
bool m_BirthdayIsSet;
|
||||||
|
|
||||||
bool m_Public_birthday;
|
double m_Points;
|
||||||
bool m_Public_birthdayIsSet;
|
bool m_PointsIsSet;
|
||||||
|
|
||||||
utility::datetime m_Birthday;
|
utility::string_t m_Location;
|
||||||
bool m_BirthdayIsSet;
|
bool m_LocationIsSet;
|
||||||
|
|
||||||
double m_Points;
|
utility::string_t m_Language;
|
||||||
bool m_PointsIsSet;
|
bool m_LanguageIsSet;
|
||||||
|
|
||||||
utility::string_t m_Location;
|
utility::string_t m_Timezone;
|
||||||
bool m_LocationIsSet;
|
bool m_TimezoneIsSet;
|
||||||
|
|
||||||
utility::string_t m_Language;
|
utility::string_t m_Currency;
|
||||||
bool m_LanguageIsSet;
|
bool m_CurrencyIsSet;
|
||||||
|
|
||||||
utility::string_t m_Timezone;
|
utility::string_t m_Photo_url;
|
||||||
bool m_TimezoneIsSet;
|
bool m_Photo_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Currency;
|
utility::string_t m_Banner_url;
|
||||||
bool m_CurrencyIsSet;
|
bool m_Banner_urlIsSet;
|
||||||
|
|
||||||
utility::string_t m_Photo_url;
|
utility::datetime m_Last_online;
|
||||||
bool m_Photo_urlIsSet;
|
bool m_Last_onlineIsSet;
|
||||||
|
|
||||||
utility::string_t m_Banner_url;
|
utility::string_t m_Biography;
|
||||||
bool m_Banner_urlIsSet;
|
bool m_BiographyIsSet;
|
||||||
|
|
||||||
utility::datetime m_Last_online;
|
int32_t m_View_count;
|
||||||
bool m_Last_onlineIsSet;
|
bool m_View_countIsSet;
|
||||||
|
|
||||||
utility::string_t m_Biography;
|
utility::datetime m_Created;
|
||||||
bool m_BiographyIsSet;
|
bool m_CreatedIsSet;
|
||||||
|
|
||||||
int32_t m_View_count;
|
utility::datetime m_Updated;
|
||||||
bool m_View_countIsSet;
|
bool m_UpdatedIsSet;
|
||||||
|
};
|
||||||
|
|
||||||
utility::datetime m_Created;
|
}
|
||||||
bool m_CreatedIsSet;
|
|
||||||
|
|
||||||
utility::datetime m_Updated;
|
|
||||||
bool m_UpdatedIsSet;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_UserInfo_H_ */
|
#endif /* TRIBUFU_MODELS_UserInfo_H_ */
|
||||||
|
@ -13,52 +13,52 @@
|
|||||||
/*
|
/*
|
||||||
* UserType.h
|
* UserType.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRIBUFU_MODELS_UserType_H_
|
#ifndef TRIBUFU_MODELS_UserType_H_
|
||||||
#define TRIBUFU_MODELS_UserType_H_
|
#define TRIBUFU_MODELS_UserType_H_
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
|
||||||
|
namespace tribufu
|
||||||
namespace tribufu {
|
|
||||||
namespace models {
|
|
||||||
|
|
||||||
|
|
||||||
class UserType
|
|
||||||
: public ModelBase
|
|
||||||
{
|
{
|
||||||
public:
|
namespace models
|
||||||
UserType();
|
|
||||||
virtual ~UserType();
|
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
|
||||||
/// ModelBase overrides
|
|
||||||
|
|
||||||
void validate() override;
|
|
||||||
|
|
||||||
web::json::value toJson() const override;
|
|
||||||
bool fromJson(const web::json::value& json) override;
|
|
||||||
|
|
||||||
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
||||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
||||||
|
|
||||||
enum class eUserType
|
|
||||||
{
|
{
|
||||||
UserType_USER,
|
|
||||||
UserType_BOT,
|
|
||||||
};
|
|
||||||
|
|
||||||
eUserType getValue() const;
|
class UserType : public ModelBase
|
||||||
void setValue(eUserType const value);
|
{
|
||||||
|
public:
|
||||||
|
UserType();
|
||||||
|
virtual ~UserType();
|
||||||
|
|
||||||
protected:
|
/////////////////////////////////////////////
|
||||||
eUserType m_value;
|
/// ModelBase overrides
|
||||||
};
|
|
||||||
|
|
||||||
}
|
void validate() override;
|
||||||
|
|
||||||
|
web::json::value toJson() const override;
|
||||||
|
bool fromJson(const web::json::value &json) override;
|
||||||
|
|
||||||
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) const override;
|
||||||
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &namePrefix) override;
|
||||||
|
|
||||||
|
enum class eUserType
|
||||||
|
{
|
||||||
|
UserType_USER,
|
||||||
|
UserType_BOT,
|
||||||
|
};
|
||||||
|
|
||||||
|
eUserType getValue() const;
|
||||||
|
void setValue(eUserType const value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
eUserType m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRIBUFU_MODELS_UserType_H_ */
|
#endif /* TRIBUFU_MODELS_UserType_H_ */
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
$env:CPP_POST_PROCESS_FILE = "clang-format -i"
|
||||||
|
|
||||||
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
|
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
|
||||||
-i https://api.tribufu.com/openapi.json `
|
-i https://api.tribufu.com/openapi.json `
|
||||||
-g cpp-restsdk `
|
-g cpp-restsdk `
|
||||||
-o . `
|
-o . `
|
||||||
|
--enable-post-process-file `
|
||||||
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
|
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
|
||||||
--additional-properties=packageName=tribufu++,apiPackage=tribufu.api,modelPackage=tribufu.models `
|
--additional-properties=packageName=tribufu++,apiPackage=tribufu.api,modelPackage=tribufu.models `
|
||||||
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
|
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
|
||||||
|
@ -12,38 +12,53 @@
|
|||||||
|
|
||||||
#include "tribufu++/AnyType.h"
|
#include "tribufu++/AnyType.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
{
|
||||||
|
namespace models
|
||||||
|
{
|
||||||
|
|
||||||
AnyType::AnyType() { m_value = web::json::value::null(); }
|
AnyType::AnyType()
|
||||||
|
{
|
||||||
|
m_value = web::json::value::null();
|
||||||
|
}
|
||||||
|
|
||||||
AnyType::~AnyType() {}
|
AnyType::~AnyType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void AnyType::validate() {}
|
void AnyType::validate()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
web::json::value AnyType::toJson() const { return m_value; }
|
web::json::value AnyType::toJson() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
bool AnyType::fromJson(const web::json::value &val) {
|
bool AnyType::fromJson(const web::json::value &val)
|
||||||
m_value = val;
|
{
|
||||||
m_IsSet = true;
|
m_value = val;
|
||||||
return isSet();
|
m_IsSet = true;
|
||||||
}
|
return isSet();
|
||||||
|
}
|
||||||
void AnyType::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
|
||||||
const utility::string_t &prefix) const {
|
void AnyType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||||
if (m_value.is_object()) {
|
{
|
||||||
return Object::toMultipart(multipart, prefix);
|
if (m_value.is_object())
|
||||||
}
|
{
|
||||||
throw std::runtime_error("AnyType::toMultipart: unsupported type");
|
return Object::toMultipart(multipart, prefix);
|
||||||
}
|
}
|
||||||
|
throw std::runtime_error("AnyType::toMultipart: unsupported type");
|
||||||
bool AnyType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
}
|
||||||
const utility::string_t &prefix) {
|
|
||||||
if (m_value.is_object()) {
|
bool AnyType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
return Object::fromMultiPart(multipart, prefix);
|
{
|
||||||
}
|
if (m_value.is_object())
|
||||||
return false;
|
{
|
||||||
}
|
return Object::fromMultiPart(multipart, prefix);
|
||||||
|
}
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,195 +11,199 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tribufu++/ApiClient.h"
|
#include "tribufu++/ApiClient.h"
|
||||||
#include "tribufu++/MultipartFormData.h"
|
|
||||||
#include "tribufu++/ModelBase.h"
|
#include "tribufu++/ModelBase.h"
|
||||||
|
#include "tribufu++/MultipartFormData.h"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <limits>
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <limits>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
template <typename T>
|
template <typename T> utility::string_t toString(const T value)
|
||||||
utility::string_t toString(const T value)
|
|
||||||
{
|
{
|
||||||
utility::ostringstream_t out;
|
utility::ostringstream_t out;
|
||||||
out << std::setprecision(std::numeric_limits<T>::digits10) << std::fixed << value;
|
out << std::setprecision(std::numeric_limits<T>::digits10) << std::fixed << value;
|
||||||
return out.str();
|
return out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace api {
|
|
||||||
|
|
||||||
using namespace tribufu::models;
|
|
||||||
|
|
||||||
ApiClient::ApiClient(std::shared_ptr<const ApiConfiguration> configuration )
|
|
||||||
: m_Configuration(configuration)
|
|
||||||
{
|
{
|
||||||
}
|
namespace api
|
||||||
ApiClient::~ApiClient()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const ApiClient::ResponseHandlerType& ApiClient::getResponseHandler() const {
|
|
||||||
return m_ResponseHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApiClient::setResponseHandler(const ResponseHandlerType& responseHandler) {
|
|
||||||
m_ResponseHandler = responseHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<const ApiConfiguration> ApiClient::getConfiguration() const
|
|
||||||
{
|
|
||||||
return m_Configuration;
|
|
||||||
}
|
|
||||||
void ApiClient::setConfiguration(std::shared_ptr<const ApiConfiguration> configuration)
|
|
||||||
{
|
|
||||||
m_Configuration = configuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t ApiClient::parameterToString(utility::string_t value)
|
|
||||||
{
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
utility::string_t ApiClient::parameterToString(int64_t value)
|
|
||||||
{
|
|
||||||
std::stringstream valueAsStringStream;
|
|
||||||
valueAsStringStream << value;
|
|
||||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
|
||||||
}
|
|
||||||
utility::string_t ApiClient::parameterToString(int32_t value)
|
|
||||||
{
|
|
||||||
std::stringstream valueAsStringStream;
|
|
||||||
valueAsStringStream << value;
|
|
||||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t ApiClient::parameterToString(float value)
|
|
||||||
{
|
|
||||||
return utility::conversions::to_string_t(toString(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t ApiClient::parameterToString(double value)
|
|
||||||
{
|
|
||||||
return utility::conversions::to_string_t(toString(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t ApiClient::parameterToString(const utility::datetime &value)
|
|
||||||
{
|
|
||||||
return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601));
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t ApiClient::parameterToString(bool value)
|
|
||||||
{
|
|
||||||
std::stringstream valueAsStringStream;
|
|
||||||
valueAsStringStream << std::boolalpha << value;
|
|
||||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
pplx::task<web::http::http_response> ApiClient::callApi(
|
|
||||||
const utility::string_t& path,
|
|
||||||
const utility::string_t& method,
|
|
||||||
const std::map<utility::string_t, utility::string_t>& queryParams,
|
|
||||||
const std::shared_ptr<IHttpBody> postBody,
|
|
||||||
const std::map<utility::string_t, utility::string_t>& headerParams,
|
|
||||||
const std::map<utility::string_t, utility::string_t>& formParams,
|
|
||||||
const std::map<utility::string_t, std::shared_ptr<HttpContent>>& fileParams,
|
|
||||||
const utility::string_t& contentType
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (postBody != nullptr && formParams.size() != 0)
|
|
||||||
{
|
{
|
||||||
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and form params"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (postBody != nullptr && fileParams.size() != 0)
|
using namespace tribufu::models;
|
||||||
{
|
|
||||||
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and file params"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fileParams.size() > 0 && contentType != utility::conversions::to_string_t("multipart/form-data"))
|
ApiClient::ApiClient(std::shared_ptr<const ApiConfiguration> configuration) : m_Configuration(configuration)
|
||||||
{
|
|
||||||
throw ApiException(400, utility::conversions::to_string_t("Operations with file parameters must be called with multipart/form-data"));
|
|
||||||
}
|
|
||||||
|
|
||||||
web::http::client::http_client client(m_Configuration->getBaseUrl(), m_Configuration->getHttpConfig());
|
|
||||||
|
|
||||||
web::http::http_request request;
|
|
||||||
for (const auto& kvp : headerParams)
|
|
||||||
{
|
|
||||||
request.headers().add(kvp.first, kvp.second);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fileParams.size() > 0)
|
|
||||||
{
|
|
||||||
MultipartFormData uploadData;
|
|
||||||
for (const auto& kvp : formParams)
|
|
||||||
{
|
{
|
||||||
uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second));
|
|
||||||
}
|
}
|
||||||
for (const auto& kvp : fileParams)
|
ApiClient::~ApiClient()
|
||||||
{
|
{
|
||||||
uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second));
|
|
||||||
}
|
}
|
||||||
std::stringstream data;
|
|
||||||
uploadData.writeTo(data);
|
const ApiClient::ResponseHandlerType &ApiClient::getResponseHandler() const
|
||||||
auto bodyString = data.str();
|
|
||||||
const auto length = bodyString.size();
|
|
||||||
request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, utility::conversions::to_string_t("multipart/form-data; boundary=") + uploadData.getBoundary());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (postBody != nullptr)
|
|
||||||
{
|
{
|
||||||
std::stringstream data;
|
return m_ResponseHandler;
|
||||||
postBody->writeTo(data);
|
|
||||||
auto bodyString = data.str();
|
|
||||||
const auto length = bodyString.size();
|
|
||||||
request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, contentType);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
void ApiClient::setResponseHandler(const ResponseHandlerType &responseHandler)
|
||||||
{
|
{
|
||||||
if (contentType == utility::conversions::to_string_t("application/json"))
|
m_ResponseHandler = responseHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<const ApiConfiguration> ApiClient::getConfiguration() const
|
||||||
|
{
|
||||||
|
return m_Configuration;
|
||||||
|
}
|
||||||
|
void ApiClient::setConfiguration(std::shared_ptr<const ApiConfiguration> configuration)
|
||||||
|
{
|
||||||
|
m_Configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiClient::parameterToString(utility::string_t value)
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
utility::string_t ApiClient::parameterToString(int64_t value)
|
||||||
|
{
|
||||||
|
std::stringstream valueAsStringStream;
|
||||||
|
valueAsStringStream << value;
|
||||||
|
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||||
|
}
|
||||||
|
utility::string_t ApiClient::parameterToString(int32_t value)
|
||||||
|
{
|
||||||
|
std::stringstream valueAsStringStream;
|
||||||
|
valueAsStringStream << value;
|
||||||
|
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiClient::parameterToString(float value)
|
||||||
|
{
|
||||||
|
return utility::conversions::to_string_t(toString(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiClient::parameterToString(double value)
|
||||||
|
{
|
||||||
|
return utility::conversions::to_string_t(toString(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiClient::parameterToString(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601));
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiClient::parameterToString(bool value)
|
||||||
|
{
|
||||||
|
std::stringstream valueAsStringStream;
|
||||||
|
valueAsStringStream << std::boolalpha << value;
|
||||||
|
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
pplx::task<web::http::http_response> ApiClient::callApi(
|
||||||
|
const utility::string_t &path, const utility::string_t &method,
|
||||||
|
const std::map<utility::string_t, utility::string_t> &queryParams,
|
||||||
|
const std::shared_ptr<IHttpBody> postBody,
|
||||||
|
const std::map<utility::string_t, utility::string_t> &headerParams,
|
||||||
|
const std::map<utility::string_t, utility::string_t> &formParams,
|
||||||
|
const std::map<utility::string_t, std::shared_ptr<HttpContent>> &fileParams,
|
||||||
|
const utility::string_t &contentType) const
|
||||||
|
{
|
||||||
|
if (postBody != nullptr && formParams.size() != 0)
|
||||||
{
|
{
|
||||||
web::json::value body_data = web::json::value::object();
|
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and form params"));
|
||||||
for (auto& kvp : formParams)
|
}
|
||||||
|
|
||||||
|
if (postBody != nullptr && fileParams.size() != 0)
|
||||||
|
{
|
||||||
|
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and file params"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileParams.size() > 0 && contentType != utility::conversions::to_string_t("multipart/form-data"))
|
||||||
|
{
|
||||||
|
throw ApiException(400, utility::conversions::to_string_t(
|
||||||
|
"Operations with file parameters must be called with multipart/form-data"));
|
||||||
|
}
|
||||||
|
|
||||||
|
web::http::client::http_client client(m_Configuration->getBaseUrl(), m_Configuration->getHttpConfig());
|
||||||
|
|
||||||
|
web::http::http_request request;
|
||||||
|
for (const auto &kvp : headerParams)
|
||||||
|
{
|
||||||
|
request.headers().add(kvp.first, kvp.second);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileParams.size() > 0)
|
||||||
|
{
|
||||||
|
MultipartFormData uploadData;
|
||||||
|
for (const auto &kvp : formParams)
|
||||||
{
|
{
|
||||||
body_data[kvp.first] = ModelBase::toJson(kvp.second);
|
uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second));
|
||||||
}
|
}
|
||||||
if (!formParams.empty())
|
for (const auto &kvp : fileParams)
|
||||||
{
|
{
|
||||||
request.set_body(body_data);
|
uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second));
|
||||||
}
|
}
|
||||||
|
std::stringstream data;
|
||||||
|
uploadData.writeTo(data);
|
||||||
|
auto bodyString = data.str();
|
||||||
|
const auto length = bodyString.size();
|
||||||
|
request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length,
|
||||||
|
utility::conversions::to_string_t("multipart/form-data; boundary=") +
|
||||||
|
uploadData.getBoundary());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
web::http::uri_builder formData;
|
if (postBody != nullptr)
|
||||||
for (const auto& kvp : formParams)
|
|
||||||
{
|
{
|
||||||
formData.append_query(kvp.first, kvp.second);
|
std::stringstream data;
|
||||||
|
postBody->writeTo(data);
|
||||||
|
auto bodyString = data.str();
|
||||||
|
const auto length = bodyString.size();
|
||||||
|
request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length,
|
||||||
|
contentType);
|
||||||
}
|
}
|
||||||
if (!formParams.empty())
|
else
|
||||||
{
|
{
|
||||||
request.set_body(formData.query(), utility::conversions::to_string_t("application/x-www-form-urlencoded"));
|
if (contentType == utility::conversions::to_string_t("application/json"))
|
||||||
|
{
|
||||||
|
web::json::value body_data = web::json::value::object();
|
||||||
|
for (auto &kvp : formParams)
|
||||||
|
{
|
||||||
|
body_data[kvp.first] = ModelBase::toJson(kvp.second);
|
||||||
|
}
|
||||||
|
if (!formParams.empty())
|
||||||
|
{
|
||||||
|
request.set_body(body_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
web::http::uri_builder formData;
|
||||||
|
for (const auto &kvp : formParams)
|
||||||
|
{
|
||||||
|
formData.append_query(kvp.first, kvp.second);
|
||||||
|
}
|
||||||
|
if (!formParams.empty())
|
||||||
|
{
|
||||||
|
request.set_body(formData.query(),
|
||||||
|
utility::conversions::to_string_t("application/x-www-form-urlencoded"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
web::http::uri_builder builder(path);
|
||||||
|
for (const auto &kvp : queryParams)
|
||||||
|
{
|
||||||
|
builder.append_query(kvp.first, kvp.second);
|
||||||
|
}
|
||||||
|
request.set_request_uri(builder.to_uri());
|
||||||
|
request.set_method(method);
|
||||||
|
if (!request.headers().has(web::http::header_names::user_agent))
|
||||||
|
{
|
||||||
|
request.headers().add(web::http::header_names::user_agent, m_Configuration->getUserAgent());
|
||||||
|
}
|
||||||
|
|
||||||
|
return client.request(request);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
web::http::uri_builder builder(path);
|
|
||||||
for (const auto& kvp : queryParams)
|
|
||||||
{
|
|
||||||
builder.append_query(kvp.first, kvp.second);
|
|
||||||
}
|
}
|
||||||
request.set_request_uri(builder.to_uri());
|
|
||||||
request.set_method(method);
|
|
||||||
if ( !request.headers().has( web::http::header_names::user_agent ) )
|
|
||||||
{
|
|
||||||
request.headers().add( web::http::header_names::user_agent, m_Configuration->getUserAgent() );
|
|
||||||
}
|
|
||||||
|
|
||||||
return client.request(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -12,71 +12,73 @@
|
|||||||
|
|
||||||
#include "tribufu++/ApiConfiguration.h"
|
#include "tribufu++/ApiConfiguration.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace api {
|
|
||||||
|
|
||||||
ApiConfiguration::ApiConfiguration()
|
|
||||||
{
|
{
|
||||||
}
|
namespace api
|
||||||
|
|
||||||
ApiConfiguration::~ApiConfiguration()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const web::http::client::http_client_config& ApiConfiguration::getHttpConfig() const
|
|
||||||
{
|
|
||||||
return m_HttpConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApiConfiguration::setHttpConfig( web::http::client::http_client_config& value )
|
|
||||||
{
|
|
||||||
m_HttpConfig = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t ApiConfiguration::getBaseUrl() const
|
|
||||||
{
|
|
||||||
return m_BaseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApiConfiguration::setBaseUrl( const utility::string_t value )
|
|
||||||
{
|
|
||||||
m_BaseUrl = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t ApiConfiguration::getUserAgent() const
|
|
||||||
{
|
|
||||||
return m_UserAgent;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApiConfiguration::setUserAgent( const utility::string_t value )
|
|
||||||
{
|
|
||||||
m_UserAgent = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<utility::string_t, utility::string_t>& ApiConfiguration::getDefaultHeaders()
|
|
||||||
{
|
|
||||||
return m_DefaultHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::map<utility::string_t, utility::string_t>& ApiConfiguration::getDefaultHeaders() const
|
|
||||||
{
|
|
||||||
return m_DefaultHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t ApiConfiguration::getApiKey( const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
auto result = m_ApiKeys.find(prefix);
|
|
||||||
if( result != m_ApiKeys.end() )
|
|
||||||
{
|
{
|
||||||
return result->second;
|
|
||||||
|
ApiConfiguration::ApiConfiguration()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiConfiguration::~ApiConfiguration()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const web::http::client::http_client_config &ApiConfiguration::getHttpConfig() const
|
||||||
|
{
|
||||||
|
return m_HttpConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiConfiguration::setHttpConfig(web::http::client::http_client_config &value)
|
||||||
|
{
|
||||||
|
m_HttpConfig = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiConfiguration::getBaseUrl() const
|
||||||
|
{
|
||||||
|
return m_BaseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiConfiguration::setBaseUrl(const utility::string_t value)
|
||||||
|
{
|
||||||
|
m_BaseUrl = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiConfiguration::getUserAgent() const
|
||||||
|
{
|
||||||
|
return m_UserAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiConfiguration::setUserAgent(const utility::string_t value)
|
||||||
|
{
|
||||||
|
m_UserAgent = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<utility::string_t, utility::string_t> &ApiConfiguration::getDefaultHeaders()
|
||||||
|
{
|
||||||
|
return m_DefaultHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<utility::string_t, utility::string_t> &ApiConfiguration::getDefaultHeaders() const
|
||||||
|
{
|
||||||
|
return m_DefaultHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t ApiConfiguration::getApiKey(const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
auto result = m_ApiKeys.find(prefix);
|
||||||
|
if (result != m_ApiKeys.end())
|
||||||
|
{
|
||||||
|
return result->second;
|
||||||
|
}
|
||||||
|
return utility::conversions::to_string_t("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiConfiguration::setApiKey(const utility::string_t &prefix, const utility::string_t &apiKey)
|
||||||
|
{
|
||||||
|
m_ApiKeys[prefix] = apiKey;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return utility::conversions::to_string_t("");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApiConfiguration::setApiKey( const utility::string_t& prefix, const utility::string_t& apiKey )
|
|
||||||
{
|
|
||||||
m_ApiKeys[prefix] = apiKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -12,39 +12,36 @@
|
|||||||
|
|
||||||
#include "tribufu++/ApiException.h"
|
#include "tribufu++/ApiException.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace api {
|
|
||||||
|
|
||||||
ApiException::ApiException( int errorCode
|
|
||||||
, const utility::string_t& message
|
|
||||||
, std::shared_ptr<std::istream> content /*= nullptr*/ )
|
|
||||||
: web::http::http_exception( errorCode, message )
|
|
||||||
, m_Content(content)
|
|
||||||
{
|
{
|
||||||
}
|
namespace api
|
||||||
ApiException::ApiException( int errorCode
|
{
|
||||||
, const utility::string_t& message
|
|
||||||
, std::map<utility::string_t, utility::string_t>& headers
|
|
||||||
, std::shared_ptr<std::istream> content /*= nullptr*/ )
|
|
||||||
: web::http::http_exception( errorCode, message )
|
|
||||||
, m_Content(content)
|
|
||||||
, m_Headers(headers)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ApiException::~ApiException()
|
ApiException::ApiException(int errorCode, const utility::string_t &message,
|
||||||
{
|
std::shared_ptr<std::istream> content /*= nullptr*/)
|
||||||
}
|
: web::http::http_exception(errorCode, message), m_Content(content)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
ApiException::ApiException(int errorCode, const utility::string_t &message,
|
||||||
|
std::map<utility::string_t, utility::string_t> &headers,
|
||||||
|
std::shared_ptr<std::istream> content /*= nullptr*/)
|
||||||
|
: web::http::http_exception(errorCode, message), m_Content(content), m_Headers(headers)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<std::istream> ApiException::getContent() const
|
ApiException::~ApiException()
|
||||||
{
|
{
|
||||||
return m_Content;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
std::map<utility::string_t, utility::string_t>& ApiException::getHeaders()
|
std::shared_ptr<std::istream> ApiException::getContent() const
|
||||||
{
|
{
|
||||||
return m_Headers;
|
return m_Content;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
std::map<utility::string_t, utility::string_t> &ApiException::getHeaders()
|
||||||
|
{
|
||||||
|
return m_Headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,72 +12,74 @@
|
|||||||
|
|
||||||
#include "tribufu++/HttpContent.h"
|
#include "tribufu++/HttpContent.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
HttpContent::HttpContent()
|
|
||||||
{
|
{
|
||||||
}
|
namespace models
|
||||||
|
{
|
||||||
|
|
||||||
HttpContent::~HttpContent()
|
HttpContent::HttpContent()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
utility::string_t HttpContent::getContentDisposition() const
|
HttpContent::~HttpContent()
|
||||||
{
|
{
|
||||||
return m_ContentDisposition;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void HttpContent::setContentDisposition( const utility::string_t & value )
|
utility::string_t HttpContent::getContentDisposition() const
|
||||||
{
|
{
|
||||||
m_ContentDisposition = value;
|
return m_ContentDisposition;
|
||||||
}
|
}
|
||||||
|
|
||||||
utility::string_t HttpContent::getName() const
|
void HttpContent::setContentDisposition(const utility::string_t &value)
|
||||||
{
|
{
|
||||||
return m_Name;
|
m_ContentDisposition = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpContent::setName( const utility::string_t & value )
|
utility::string_t HttpContent::getName() const
|
||||||
{
|
{
|
||||||
m_Name = value;
|
return m_Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
utility::string_t HttpContent::getFileName() const
|
void HttpContent::setName(const utility::string_t &value)
|
||||||
{
|
{
|
||||||
return m_FileName;
|
m_Name = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpContent::setFileName( const utility::string_t & value )
|
utility::string_t HttpContent::getFileName() const
|
||||||
{
|
{
|
||||||
m_FileName = value;
|
return m_FileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
utility::string_t HttpContent::getContentType() const
|
void HttpContent::setFileName(const utility::string_t &value)
|
||||||
{
|
{
|
||||||
return m_ContentType;
|
m_FileName = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpContent::setContentType( const utility::string_t & value )
|
utility::string_t HttpContent::getContentType() const
|
||||||
{
|
{
|
||||||
m_ContentType = value;
|
return m_ContentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<std::istream> HttpContent::getData() const
|
void HttpContent::setContentType(const utility::string_t &value)
|
||||||
{
|
{
|
||||||
return m_Data;
|
m_ContentType = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpContent::setData( std::shared_ptr<std::istream> value )
|
std::shared_ptr<std::istream> HttpContent::getData() const
|
||||||
{
|
{
|
||||||
m_Data = value;
|
return m_Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpContent::writeTo( std::ostream& stream )
|
void HttpContent::setData(std::shared_ptr<std::istream> value)
|
||||||
{
|
{
|
||||||
m_Data->seekg( 0, m_Data->beg );
|
m_Data = value;
|
||||||
stream << m_Data->rdbuf();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
void HttpContent::writeTo(std::ostream &stream)
|
||||||
|
{
|
||||||
|
m_Data->seekg(0, m_Data->beg);
|
||||||
|
stream << m_Data->rdbuf();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,22 +12,23 @@
|
|||||||
|
|
||||||
#include "tribufu++/JsonBody.h"
|
#include "tribufu++/JsonBody.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
JsonBody::JsonBody( const web::json::value& json)
|
|
||||||
: m_Json(json)
|
|
||||||
{
|
{
|
||||||
}
|
namespace models
|
||||||
|
{
|
||||||
|
|
||||||
JsonBody::~JsonBody()
|
JsonBody::JsonBody(const web::json::value &json) : m_Json(json)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsonBody::writeTo( std::ostream& target )
|
JsonBody::~JsonBody()
|
||||||
{
|
{
|
||||||
m_Json.serialize(target);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
void JsonBody::writeTo(std::ostream &target)
|
||||||
|
{
|
||||||
|
m_Json.serialize(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
1264
src/ModelBase.cpp
1264
src/ModelBase.cpp
File diff suppressed because it is too large
Load Diff
@ -16,94 +16,97 @@
|
|||||||
#include <boost/uuid/random_generator.hpp>
|
#include <boost/uuid/random_generator.hpp>
|
||||||
#include <boost/uuid/uuid_io.hpp>
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
MultipartFormData::MultipartFormData()
|
|
||||||
{
|
{
|
||||||
utility::stringstream_t uuidString;
|
namespace models
|
||||||
uuidString << boost::uuids::random_generator()();
|
|
||||||
m_Boundary = uuidString.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
MultipartFormData::MultipartFormData(const utility::string_t& boundary)
|
|
||||||
: m_Boundary(boundary)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MultipartFormData::~MultipartFormData()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
utility::string_t MultipartFormData::getBoundary()
|
|
||||||
{
|
|
||||||
return m_Boundary;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MultipartFormData::add( std::shared_ptr<HttpContent> content )
|
|
||||||
{
|
|
||||||
m_Contents.push_back( content );
|
|
||||||
m_ContentLookup[content->getName()] = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MultipartFormData::hasContent(const utility::string_t& name) const
|
|
||||||
{
|
|
||||||
return m_ContentLookup.find(name) != m_ContentLookup.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<HttpContent> MultipartFormData::getContent(const utility::string_t& name) const
|
|
||||||
{
|
|
||||||
auto result = m_ContentLookup.find(name);
|
|
||||||
if(result == m_ContentLookup.end())
|
|
||||||
{
|
{
|
||||||
return std::shared_ptr<HttpContent>(nullptr);
|
|
||||||
|
MultipartFormData::MultipartFormData()
|
||||||
|
{
|
||||||
|
utility::stringstream_t uuidString;
|
||||||
|
uuidString << boost::uuids::random_generator()();
|
||||||
|
m_Boundary = uuidString.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
MultipartFormData::MultipartFormData(const utility::string_t &boundary) : m_Boundary(boundary)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MultipartFormData::~MultipartFormData()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t MultipartFormData::getBoundary()
|
||||||
|
{
|
||||||
|
return m_Boundary;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MultipartFormData::add(std::shared_ptr<HttpContent> content)
|
||||||
|
{
|
||||||
|
m_Contents.push_back(content);
|
||||||
|
m_ContentLookup[content->getName()] = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MultipartFormData::hasContent(const utility::string_t &name) const
|
||||||
|
{
|
||||||
|
return m_ContentLookup.find(name) != m_ContentLookup.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<HttpContent> MultipartFormData::getContent(const utility::string_t &name) const
|
||||||
|
{
|
||||||
|
auto result = m_ContentLookup.find(name);
|
||||||
|
if (result == m_ContentLookup.end())
|
||||||
|
{
|
||||||
|
return std::shared_ptr<HttpContent>(nullptr);
|
||||||
|
}
|
||||||
|
return result->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MultipartFormData::writeTo(std::ostream &target)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_Contents.size(); i++)
|
||||||
|
{
|
||||||
|
std::shared_ptr<HttpContent> content = m_Contents[i];
|
||||||
|
|
||||||
|
// boundary
|
||||||
|
target << "\r\n"
|
||||||
|
<< "--" << utility::conversions::to_utf8string(m_Boundary) << "\r\n";
|
||||||
|
|
||||||
|
// headers
|
||||||
|
target << "Content-Disposition: "
|
||||||
|
<< utility::conversions::to_utf8string(content->getContentDisposition());
|
||||||
|
if (content->getName().size() > 0)
|
||||||
|
{
|
||||||
|
target << "; name=\"" << utility::conversions::to_utf8string(content->getName()) << "\"";
|
||||||
|
}
|
||||||
|
if (content->getFileName().size() > 0)
|
||||||
|
{
|
||||||
|
target << "; filename=\"" << utility::conversions::to_utf8string(content->getFileName()) << "\"";
|
||||||
|
}
|
||||||
|
target << "\r\n";
|
||||||
|
|
||||||
|
if (content->getContentType().size() > 0)
|
||||||
|
{
|
||||||
|
target << "Content-Type: " << utility::conversions::to_utf8string(content->getContentType())
|
||||||
|
<< "\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
target << "\r\n";
|
||||||
|
|
||||||
|
// body
|
||||||
|
std::shared_ptr<std::istream> data = content->getData();
|
||||||
|
|
||||||
|
data->seekg(0, data->end);
|
||||||
|
std::vector<char> dataBytes(data->tellg());
|
||||||
|
|
||||||
|
data->seekg(0, data->beg);
|
||||||
|
data->read(&dataBytes[0], dataBytes.size());
|
||||||
|
|
||||||
|
std::copy(dataBytes.begin(), dataBytes.end(), std::ostreambuf_iterator<char>(target));
|
||||||
|
}
|
||||||
|
|
||||||
|
target << "\r\n--" << utility::conversions::to_utf8string(m_Boundary) << "--\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return result->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MultipartFormData::writeTo( std::ostream& target )
|
|
||||||
{
|
|
||||||
for ( size_t i = 0; i < m_Contents.size(); i++ )
|
|
||||||
{
|
|
||||||
std::shared_ptr<HttpContent> content = m_Contents[i];
|
|
||||||
|
|
||||||
// boundary
|
|
||||||
target << "\r\n" << "--" << utility::conversions::to_utf8string( m_Boundary ) << "\r\n";
|
|
||||||
|
|
||||||
// headers
|
|
||||||
target << "Content-Disposition: " << utility::conversions::to_utf8string( content->getContentDisposition() );
|
|
||||||
if ( content->getName().size() > 0 )
|
|
||||||
{
|
|
||||||
target << "; name=\"" << utility::conversions::to_utf8string( content->getName() ) << "\"";
|
|
||||||
}
|
|
||||||
if ( content->getFileName().size() > 0 )
|
|
||||||
{
|
|
||||||
target << "; filename=\"" << utility::conversions::to_utf8string( content->getFileName() ) << "\"";
|
|
||||||
}
|
|
||||||
target << "\r\n";
|
|
||||||
|
|
||||||
if ( content->getContentType().size() > 0 )
|
|
||||||
{
|
|
||||||
target << "Content-Type: " << utility::conversions::to_utf8string( content->getContentType() ) << "\r\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
target << "\r\n";
|
|
||||||
|
|
||||||
// body
|
|
||||||
std::shared_ptr<std::istream> data = content->getData();
|
|
||||||
|
|
||||||
data->seekg( 0, data->end );
|
|
||||||
std::vector<char> dataBytes( data->tellg() );
|
|
||||||
|
|
||||||
data->seekg( 0, data->beg );
|
|
||||||
data->read( &dataBytes[0], dataBytes.size() );
|
|
||||||
|
|
||||||
std::copy( dataBytes.begin(), dataBytes.end(), std::ostreambuf_iterator<char>( target ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
target << "\r\n--" << utility::conversions::to_utf8string( m_Boundary ) << "--\r\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
132
src/Object.cpp
132
src/Object.cpp
@ -12,77 +12,81 @@
|
|||||||
|
|
||||||
#include "tribufu++/Object.h"
|
#include "tribufu++/Object.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
Object::Object()
|
|
||||||
{
|
{
|
||||||
m_object = web::json::value::object();
|
namespace models
|
||||||
}
|
|
||||||
|
|
||||||
Object::~Object()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Object::validate()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value Object::toJson() const
|
|
||||||
{
|
|
||||||
return m_object;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Object::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
if (val.is_object())
|
|
||||||
{
|
{
|
||||||
m_object = val;
|
|
||||||
m_IsSet = true;
|
|
||||||
}
|
|
||||||
return isSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Object::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
Object::Object()
|
||||||
{
|
{
|
||||||
utility::string_t namePrefix = prefix;
|
m_object = web::json::value::object();
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
}
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(".");
|
|
||||||
}
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("object"), m_object));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Object::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
Object::~Object()
|
||||||
{
|
{
|
||||||
utility::string_t namePrefix = prefix;
|
}
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(".");
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ModelBase::fromHttpContent(multipart->getContent(namePrefix + utility::conversions::to_string_t("object")), m_object ) )
|
void Object::validate()
|
||||||
{
|
{
|
||||||
m_IsSet = true;
|
}
|
||||||
}
|
|
||||||
return isSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value Object::getValue(const utility::string_t& key) const
|
web::json::value Object::toJson() const
|
||||||
{
|
{
|
||||||
return m_object.at(key);
|
return m_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Object::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
if (val.is_object())
|
||||||
|
{
|
||||||
|
m_object = val;
|
||||||
|
m_IsSet = true;
|
||||||
|
}
|
||||||
|
return isSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Object::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(".");
|
||||||
|
}
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("object"), m_object));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Object::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t("."))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(".");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(namePrefix + utility::conversions::to_string_t("object")), m_object))
|
||||||
|
{
|
||||||
|
m_IsSet = true;
|
||||||
|
}
|
||||||
|
return isSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value Object::getValue(const utility::string_t &key) const
|
||||||
|
{
|
||||||
|
return m_object.at(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Object::setValue(const utility::string_t &key, const web::json::value &value)
|
||||||
|
{
|
||||||
|
if (!value.is_null())
|
||||||
|
{
|
||||||
|
m_object[key] = value;
|
||||||
|
m_IsSet = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Object::setValue(const utility::string_t& key, const web::json::value& value)
|
|
||||||
{
|
|
||||||
if( !value.is_null() )
|
|
||||||
{
|
|
||||||
m_object[key] = value;
|
|
||||||
m_IsSet = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -10,452 +10,451 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/Account.h"
|
#include "tribufu++/model/Account.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
Account::Account()
|
|
||||||
{
|
{
|
||||||
m_Id = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_IdIsSet = false;
|
|
||||||
m_Name = utility::conversions::to_string_t("");
|
|
||||||
m_NameIsSet = false;
|
|
||||||
m_ProviderIsSet = false;
|
|
||||||
m_User_id = utility::conversions::to_string_t("");
|
|
||||||
m_User_idIsSet = false;
|
|
||||||
m_Authorized = false;
|
|
||||||
m_AuthorizedIsSet = false;
|
|
||||||
m_FieldsIsSet = false;
|
|
||||||
m_Created = utility::datetime();
|
|
||||||
m_CreatedIsSet = false;
|
|
||||||
m_Updated = utility::datetime();
|
|
||||||
m_UpdatedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Account::~Account()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value Account::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_IdIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
|
||||||
}
|
|
||||||
if(m_ProviderIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("provider"))] = ModelBase::toJson(m_Provider);
|
|
||||||
}
|
|
||||||
if(m_User_idIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("user_id"))] = ModelBase::toJson(m_User_id);
|
|
||||||
}
|
|
||||||
if(m_AuthorizedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("authorized"))] = ModelBase::toJson(m_Authorized);
|
|
||||||
}
|
|
||||||
if(m_FieldsIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("fields"))] = ModelBase::toJson(m_Fields);
|
|
||||||
}
|
|
||||||
if(m_CreatedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("created"))] = ModelBase::toJson(m_Created);
|
|
||||||
}
|
|
||||||
if(m_UpdatedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("updated"))] = ModelBase::toJson(m_Updated);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("id"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
|
|
||||||
if(!fieldValue.is_null())
|
Account::Account()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setId;
|
m_Id = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
m_IdIsSet = false;
|
||||||
setId(refVal_setId);
|
m_Name = utility::conversions::to_string_t("");
|
||||||
|
m_NameIsSet = false;
|
||||||
|
m_ProviderIsSet = false;
|
||||||
|
m_User_id = utility::conversions::to_string_t("");
|
||||||
|
m_User_idIsSet = false;
|
||||||
|
m_Authorized = false;
|
||||||
|
m_AuthorizedIsSet = false;
|
||||||
|
m_FieldsIsSet = false;
|
||||||
|
m_Created = utility::datetime();
|
||||||
|
m_CreatedIsSet = false;
|
||||||
|
m_Updated = utility::datetime();
|
||||||
|
m_UpdatedIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
Account::~Account()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
|
||||||
setName(refVal_setName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("provider"))))
|
void Account::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("provider")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<LoginProvider> refVal_setProvider;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setProvider);
|
|
||||||
setProvider(refVal_setProvider);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("user_id"))))
|
web::json::value Account::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("user_id")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setUserId;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUserId);
|
if (m_IdIsSet)
|
||||||
setUserId(refVal_setUserId);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||||
|
}
|
||||||
|
if (m_ProviderIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("provider"))] = ModelBase::toJson(m_Provider);
|
||||||
|
}
|
||||||
|
if (m_User_idIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("user_id"))] = ModelBase::toJson(m_User_id);
|
||||||
|
}
|
||||||
|
if (m_AuthorizedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("authorized"))] = ModelBase::toJson(m_Authorized);
|
||||||
|
}
|
||||||
|
if (m_FieldsIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("fields"))] = ModelBase::toJson(m_Fields);
|
||||||
|
}
|
||||||
|
if (m_CreatedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("created"))] = ModelBase::toJson(m_Created);
|
||||||
|
}
|
||||||
|
if (m_UpdatedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("updated"))] = ModelBase::toJson(m_Updated);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("authorized"))))
|
bool Account::fromJson(const web::json::value &val)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("authorized")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
bool refVal_setAuthorized;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setAuthorized);
|
if (val.has_field(utility::conversions::to_string_t(U("id"))))
|
||||||
setAuthorized(refVal_setAuthorized);
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||||
|
setId(refVal_setId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("provider"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("provider")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<LoginProvider> refVal_setProvider;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setProvider);
|
||||||
|
setProvider(refVal_setProvider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("user_id"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("user_id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setUserId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setUserId);
|
||||||
|
setUserId(refVal_setUserId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("authorized"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("authorized")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
bool refVal_setAuthorized;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setAuthorized);
|
||||||
|
setAuthorized(refVal_setAuthorized);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("fields"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("fields")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<AnyType> refVal_setFields;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setFields);
|
||||||
|
setFields(refVal_setFields);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("created"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("created")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setCreated;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setCreated);
|
||||||
|
setCreated(refVal_setCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("updated"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("updated")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setUpdated;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setUpdated);
|
||||||
|
setUpdated(refVal_setUpdated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("fields"))))
|
void Account::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fields")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<AnyType> refVal_setFields;
|
utility::string_t namePrefix = prefix;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setFields);
|
if (namePrefix.size() > 0 &&
|
||||||
setFields(refVal_setFields);
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_IdIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||||
|
}
|
||||||
|
if (m_ProviderIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("provider")),
|
||||||
|
m_Provider));
|
||||||
|
}
|
||||||
|
if (m_User_idIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("user_id")), m_User_id));
|
||||||
|
}
|
||||||
|
if (m_AuthorizedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("authorized")),
|
||||||
|
m_Authorized));
|
||||||
|
}
|
||||||
|
if (m_FieldsIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fields")), m_Fields));
|
||||||
|
}
|
||||||
|
if (m_CreatedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("created")), m_Created));
|
||||||
|
}
|
||||||
|
if (m_UpdatedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("updated")), m_Updated));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("created"))))
|
bool Account::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("created")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setCreated;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCreated);
|
utility::string_t namePrefix = prefix;
|
||||||
setCreated(refVal_setCreated);
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setId;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))),
|
||||||
|
refVal_setId);
|
||||||
|
setId(refVal_setId);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))),
|
||||||
|
refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("provider"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<LoginProvider> refVal_setProvider;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("provider"))), refVal_setProvider);
|
||||||
|
setProvider(refVal_setProvider);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("user_id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setUserId;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("user_id"))),
|
||||||
|
refVal_setUserId);
|
||||||
|
setUserId(refVal_setUserId);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("authorized"))))
|
||||||
|
{
|
||||||
|
bool refVal_setAuthorized;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("authorized"))), refVal_setAuthorized);
|
||||||
|
setAuthorized(refVal_setAuthorized);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("fields"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<AnyType> refVal_setFields;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fields"))),
|
||||||
|
refVal_setFields);
|
||||||
|
setFields(refVal_setFields);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("created"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setCreated;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("created"))),
|
||||||
|
refVal_setCreated);
|
||||||
|
setCreated(refVal_setCreated);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("updated"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setUpdated;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("updated"))),
|
||||||
|
refVal_setUpdated);
|
||||||
|
setUpdated(refVal_setUpdated);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("updated"))))
|
utility::string_t Account::getId() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("updated")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setUpdated;
|
return m_Id;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUpdated);
|
}
|
||||||
setUpdated(refVal_setUpdated);
|
|
||||||
|
void Account::setId(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Id = value;
|
||||||
|
m_IdIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::idIsSet() const
|
||||||
|
{
|
||||||
|
return m_IdIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetId()
|
||||||
|
{
|
||||||
|
m_IdIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t Account::getName() const
|
||||||
|
{
|
||||||
|
return m_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setName(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Name = value;
|
||||||
|
m_NameIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::nameIsSet() const
|
||||||
|
{
|
||||||
|
return m_NameIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetName()
|
||||||
|
{
|
||||||
|
m_NameIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<LoginProvider> Account::getProvider() const
|
||||||
|
{
|
||||||
|
return m_Provider;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setProvider(const std::shared_ptr<LoginProvider> &value)
|
||||||
|
{
|
||||||
|
m_Provider = value;
|
||||||
|
m_ProviderIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::providerIsSet() const
|
||||||
|
{
|
||||||
|
return m_ProviderIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetProvider()
|
||||||
|
{
|
||||||
|
m_ProviderIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t Account::getUserId() const
|
||||||
|
{
|
||||||
|
return m_User_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setUserId(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_User_id = value;
|
||||||
|
m_User_idIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::userIdIsSet() const
|
||||||
|
{
|
||||||
|
return m_User_idIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetUser_id()
|
||||||
|
{
|
||||||
|
m_User_idIsSet = false;
|
||||||
|
}
|
||||||
|
bool Account::isAuthorized() const
|
||||||
|
{
|
||||||
|
return m_Authorized;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setAuthorized(bool value)
|
||||||
|
{
|
||||||
|
m_Authorized = value;
|
||||||
|
m_AuthorizedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::authorizedIsSet() const
|
||||||
|
{
|
||||||
|
return m_AuthorizedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetAuthorized()
|
||||||
|
{
|
||||||
|
m_AuthorizedIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<AnyType> Account::getFields() const
|
||||||
|
{
|
||||||
|
return m_Fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setFields(const std::shared_ptr<AnyType> &value)
|
||||||
|
{
|
||||||
|
m_Fields = value;
|
||||||
|
m_FieldsIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::fieldsIsSet() const
|
||||||
|
{
|
||||||
|
return m_FieldsIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetFields()
|
||||||
|
{
|
||||||
|
m_FieldsIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime Account::getCreated() const
|
||||||
|
{
|
||||||
|
return m_Created;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setCreated(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Created = value;
|
||||||
|
m_CreatedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::createdIsSet() const
|
||||||
|
{
|
||||||
|
return m_CreatedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetCreated()
|
||||||
|
{
|
||||||
|
m_CreatedIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime Account::getUpdated() const
|
||||||
|
{
|
||||||
|
return m_Updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setUpdated(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Updated = value;
|
||||||
|
m_UpdatedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Account::updatedIsSet() const
|
||||||
|
{
|
||||||
|
return m_UpdatedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::unsetUpdated()
|
||||||
|
{
|
||||||
|
m_UpdatedIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_IdIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
|
||||||
}
|
|
||||||
if(m_ProviderIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("provider")), m_Provider));
|
|
||||||
}
|
|
||||||
if(m_User_idIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("user_id")), m_User_id));
|
|
||||||
}
|
|
||||||
if(m_AuthorizedIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("authorized")), m_Authorized));
|
|
||||||
}
|
|
||||||
if(m_FieldsIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("fields")), m_Fields));
|
|
||||||
}
|
|
||||||
if(m_CreatedIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("created")), m_Created));
|
|
||||||
}
|
|
||||||
if(m_UpdatedIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("updated")), m_Updated));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Account::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
|
||||||
setId(refVal_setId);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
|
||||||
setName(refVal_setName);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("provider"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<LoginProvider> refVal_setProvider;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("provider"))), refVal_setProvider );
|
|
||||||
setProvider(refVal_setProvider);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("user_id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setUserId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("user_id"))), refVal_setUserId );
|
|
||||||
setUserId(refVal_setUserId);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("authorized"))))
|
|
||||||
{
|
|
||||||
bool refVal_setAuthorized;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("authorized"))), refVal_setAuthorized );
|
|
||||||
setAuthorized(refVal_setAuthorized);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("fields"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<AnyType> refVal_setFields;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("fields"))), refVal_setFields );
|
|
||||||
setFields(refVal_setFields);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("created"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setCreated;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("created"))), refVal_setCreated );
|
|
||||||
setCreated(refVal_setCreated);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("updated"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setUpdated;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("updated"))), refVal_setUpdated );
|
|
||||||
setUpdated(refVal_setUpdated);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t Account::getId() const
|
|
||||||
{
|
|
||||||
return m_Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Account::setId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Id = value;
|
|
||||||
m_IdIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::idIsSet() const
|
|
||||||
{
|
|
||||||
return m_IdIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetId()
|
|
||||||
{
|
|
||||||
m_IdIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t Account::getName() const
|
|
||||||
{
|
|
||||||
return m_Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Account::setName(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Name = value;
|
|
||||||
m_NameIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::nameIsSet() const
|
|
||||||
{
|
|
||||||
return m_NameIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetName()
|
|
||||||
{
|
|
||||||
m_NameIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<LoginProvider> Account::getProvider() const
|
|
||||||
{
|
|
||||||
return m_Provider;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Account::setProvider(const std::shared_ptr<LoginProvider>& value)
|
|
||||||
{
|
|
||||||
m_Provider = value;
|
|
||||||
m_ProviderIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::providerIsSet() const
|
|
||||||
{
|
|
||||||
return m_ProviderIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetProvider()
|
|
||||||
{
|
|
||||||
m_ProviderIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t Account::getUserId() const
|
|
||||||
{
|
|
||||||
return m_User_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Account::setUserId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_User_id = value;
|
|
||||||
m_User_idIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::userIdIsSet() const
|
|
||||||
{
|
|
||||||
return m_User_idIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetUser_id()
|
|
||||||
{
|
|
||||||
m_User_idIsSet = false;
|
|
||||||
}
|
|
||||||
bool Account::isAuthorized() const
|
|
||||||
{
|
|
||||||
return m_Authorized;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::setAuthorized(bool value)
|
|
||||||
{
|
|
||||||
m_Authorized = value;
|
|
||||||
m_AuthorizedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::authorizedIsSet() const
|
|
||||||
{
|
|
||||||
return m_AuthorizedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetAuthorized()
|
|
||||||
{
|
|
||||||
m_AuthorizedIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<AnyType> Account::getFields() const
|
|
||||||
{
|
|
||||||
return m_Fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Account::setFields(const std::shared_ptr<AnyType>& value)
|
|
||||||
{
|
|
||||||
m_Fields = value;
|
|
||||||
m_FieldsIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::fieldsIsSet() const
|
|
||||||
{
|
|
||||||
return m_FieldsIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetFields()
|
|
||||||
{
|
|
||||||
m_FieldsIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime Account::getCreated() const
|
|
||||||
{
|
|
||||||
return m_Created;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Account::setCreated(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Created = value;
|
|
||||||
m_CreatedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::createdIsSet() const
|
|
||||||
{
|
|
||||||
return m_CreatedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetCreated()
|
|
||||||
{
|
|
||||||
m_CreatedIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime Account::getUpdated() const
|
|
||||||
{
|
|
||||||
return m_Updated;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Account::setUpdated(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Updated = value;
|
|
||||||
m_UpdatedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Account::updatedIsSet() const
|
|
||||||
{
|
|
||||||
return m_UpdatedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Account::unsetUpdated()
|
|
||||||
{
|
|
||||||
m_UpdatedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -10,109 +10,109 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/ApplicationType.h"
|
#include "tribufu++/model/ApplicationType.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
ApplicationType::eApplicationType toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("application")))
|
|
||||||
return ApplicationType::eApplicationType::ApplicationType_APPLICATION;
|
|
||||||
if (val == utility::conversions::to_string_t(U("game")))
|
|
||||||
return ApplicationType::eApplicationType::ApplicationType_GAME;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(ApplicationType::eApplicationType e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case ApplicationType::eApplicationType::ApplicationType_APPLICATION:
|
|
||||||
return U("application");
|
|
||||||
case ApplicationType::eApplicationType::ApplicationType_GAME:
|
|
||||||
return U("game");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplicationType::ApplicationType()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplicationType::~ApplicationType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationType::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value ApplicationType::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ApplicationType::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ApplicationType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
ApplicationType::eApplicationType toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("application")))
|
||||||
|
return ApplicationType::eApplicationType::ApplicationType_APPLICATION;
|
||||||
|
if (val == utility::conversions::to_string_t(U("game")))
|
||||||
|
return ApplicationType::eApplicationType::ApplicationType_GAME;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(ApplicationType::eApplicationType e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case ApplicationType::eApplicationType::ApplicationType_APPLICATION:
|
||||||
|
return U("application");
|
||||||
|
case ApplicationType::eApplicationType::ApplicationType_GAME:
|
||||||
|
return U("game");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApplicationType::ApplicationType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplicationType::~ApplicationType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplicationType::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value ApplicationType::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ApplicationType::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplicationType::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ApplicationType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplicationType::eApplicationType ApplicationType::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplicationType::setValue(ApplicationType::eApplicationType const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationType::eApplicationType ApplicationType::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationType::setValue(ApplicationType::eApplicationType const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,404 +10,411 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/AuthorizeRequest.h"
|
#include "tribufu++/model/AuthorizeRequest.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
AuthorizeRequest::AuthorizeRequest()
|
|
||||||
{
|
{
|
||||||
m_Response_typeIsSet = false;
|
namespace models
|
||||||
m_Client_id = utility::conversions::to_string_t("");
|
|
||||||
m_Client_idIsSet = false;
|
|
||||||
m_Code_challenge = utility::conversions::to_string_t("");
|
|
||||||
m_Code_challengeIsSet = false;
|
|
||||||
m_Code_challenge_methodIsSet = false;
|
|
||||||
m_Redirect_uri = utility::conversions::to_string_t("");
|
|
||||||
m_Redirect_uriIsSet = false;
|
|
||||||
m_Scope = utility::conversions::to_string_t("");
|
|
||||||
m_ScopeIsSet = false;
|
|
||||||
m_State = utility::conversions::to_string_t("");
|
|
||||||
m_StateIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
AuthorizeRequest::~AuthorizeRequest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value AuthorizeRequest::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_Response_typeIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("response_type"))] = ModelBase::toJson(m_Response_type);
|
|
||||||
}
|
|
||||||
if(m_Client_idIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("client_id"))] = ModelBase::toJson(m_Client_id);
|
|
||||||
}
|
|
||||||
if(m_Code_challengeIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("code_challenge"))] = ModelBase::toJson(m_Code_challenge);
|
|
||||||
}
|
|
||||||
if(m_Code_challenge_methodIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("code_challenge_method"))] = ModelBase::toJson(m_Code_challenge_method);
|
|
||||||
}
|
|
||||||
if(m_Redirect_uriIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("redirect_uri"))] = ModelBase::toJson(m_Redirect_uri);
|
|
||||||
}
|
|
||||||
if(m_ScopeIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("scope"))] = ModelBase::toJson(m_Scope);
|
|
||||||
}
|
|
||||||
if(m_StateIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("state"))] = ModelBase::toJson(m_State);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("response_type"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("response_type")));
|
|
||||||
if(!fieldValue.is_null())
|
AuthorizeRequest::AuthorizeRequest()
|
||||||
{
|
{
|
||||||
std::shared_ptr<ResponseType> refVal_setResponseType;
|
m_Response_typeIsSet = false;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setResponseType);
|
m_Client_id = utility::conversions::to_string_t("");
|
||||||
setResponseType(refVal_setResponseType);
|
m_Client_idIsSet = false;
|
||||||
|
m_Code_challenge = utility::conversions::to_string_t("");
|
||||||
|
m_Code_challengeIsSet = false;
|
||||||
|
m_Code_challenge_methodIsSet = false;
|
||||||
|
m_Redirect_uri = utility::conversions::to_string_t("");
|
||||||
|
m_Redirect_uriIsSet = false;
|
||||||
|
m_Scope = utility::conversions::to_string_t("");
|
||||||
|
m_ScopeIsSet = false;
|
||||||
|
m_State = utility::conversions::to_string_t("");
|
||||||
|
m_StateIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("client_id"))))
|
AuthorizeRequest::~AuthorizeRequest()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("client_id")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setClientId;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setClientId);
|
|
||||||
setClientId(refVal_setClientId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("code_challenge"))))
|
void AuthorizeRequest::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("code_challenge")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setCodeChallenge;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCodeChallenge);
|
|
||||||
setCodeChallenge(refVal_setCodeChallenge);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("code_challenge_method"))))
|
web::json::value AuthorizeRequest::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("code_challenge_method")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<CodeChallengeMethod> refVal_setCodeChallengeMethod;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCodeChallengeMethod);
|
if (m_Response_typeIsSet)
|
||||||
setCodeChallengeMethod(refVal_setCodeChallengeMethod);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("response_type"))] = ModelBase::toJson(m_Response_type);
|
||||||
|
}
|
||||||
|
if (m_Client_idIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("client_id"))] = ModelBase::toJson(m_Client_id);
|
||||||
|
}
|
||||||
|
if (m_Code_challengeIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("code_challenge"))] = ModelBase::toJson(m_Code_challenge);
|
||||||
|
}
|
||||||
|
if (m_Code_challenge_methodIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("code_challenge_method"))] =
|
||||||
|
ModelBase::toJson(m_Code_challenge_method);
|
||||||
|
}
|
||||||
|
if (m_Redirect_uriIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("redirect_uri"))] = ModelBase::toJson(m_Redirect_uri);
|
||||||
|
}
|
||||||
|
if (m_ScopeIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("scope"))] = ModelBase::toJson(m_Scope);
|
||||||
|
}
|
||||||
|
if (m_StateIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("state"))] = ModelBase::toJson(m_State);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("redirect_uri"))))
|
bool AuthorizeRequest::fromJson(const web::json::value &val)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("redirect_uri")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setRedirectUri;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRedirectUri);
|
if (val.has_field(utility::conversions::to_string_t(U("response_type"))))
|
||||||
setRedirectUri(refVal_setRedirectUri);
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("response_type")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<ResponseType> refVal_setResponseType;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setResponseType);
|
||||||
|
setResponseType(refVal_setResponseType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("client_id"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("client_id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setClientId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setClientId);
|
||||||
|
setClientId(refVal_setClientId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("code_challenge"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("code_challenge")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setCodeChallenge;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setCodeChallenge);
|
||||||
|
setCodeChallenge(refVal_setCodeChallenge);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("code_challenge_method"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue =
|
||||||
|
val.at(utility::conversions::to_string_t(U("code_challenge_method")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<CodeChallengeMethod> refVal_setCodeChallengeMethod;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setCodeChallengeMethod);
|
||||||
|
setCodeChallengeMethod(refVal_setCodeChallengeMethod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("redirect_uri"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("redirect_uri")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setRedirectUri;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setRedirectUri);
|
||||||
|
setRedirectUri(refVal_setRedirectUri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("scope"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("scope")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setScope;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setScope);
|
||||||
|
setScope(refVal_setScope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("state"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("state")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setState;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setState);
|
||||||
|
setState(refVal_setState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("scope"))))
|
void AuthorizeRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
{
|
const utility::string_t &prefix) const
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("scope")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setScope;
|
utility::string_t namePrefix = prefix;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setScope);
|
if (namePrefix.size() > 0 &&
|
||||||
setScope(refVal_setScope);
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_Response_typeIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("response_type")), m_Response_type));
|
||||||
|
}
|
||||||
|
if (m_Client_idIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("client_id")),
|
||||||
|
m_Client_id));
|
||||||
|
}
|
||||||
|
if (m_Code_challengeIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("code_challenge")), m_Code_challenge));
|
||||||
|
}
|
||||||
|
if (m_Code_challenge_methodIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code_challenge_method")),
|
||||||
|
m_Code_challenge_method));
|
||||||
|
}
|
||||||
|
if (m_Redirect_uriIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("redirect_uri")), m_Redirect_uri));
|
||||||
|
}
|
||||||
|
if (m_ScopeIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("scope")), m_Scope));
|
||||||
|
}
|
||||||
|
if (m_StateIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("state")), m_State));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("state"))))
|
bool AuthorizeRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
{
|
const utility::string_t &prefix)
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("state")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setState;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setState);
|
utility::string_t namePrefix = prefix;
|
||||||
setState(refVal_setState);
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("response_type"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<ResponseType> refVal_setResponseType;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("response_type"))),
|
||||||
|
refVal_setResponseType);
|
||||||
|
setResponseType(refVal_setResponseType);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("client_id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setClientId;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("client_id"))), refVal_setClientId);
|
||||||
|
setClientId(refVal_setClientId);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("code_challenge"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setCodeChallenge;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("code_challenge"))),
|
||||||
|
refVal_setCodeChallenge);
|
||||||
|
setCodeChallenge(refVal_setCodeChallenge);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("code_challenge_method"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<CodeChallengeMethod> refVal_setCodeChallengeMethod;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("code_challenge_method"))),
|
||||||
|
refVal_setCodeChallengeMethod);
|
||||||
|
setCodeChallengeMethod(refVal_setCodeChallengeMethod);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("redirect_uri"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setRedirectUri;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("redirect_uri"))), refVal_setRedirectUri);
|
||||||
|
setRedirectUri(refVal_setRedirectUri);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("scope"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setScope;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("scope"))),
|
||||||
|
refVal_setScope);
|
||||||
|
setScope(refVal_setScope);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("state"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setState;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("state"))),
|
||||||
|
refVal_setState);
|
||||||
|
setState(refVal_setState);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<ResponseType> AuthorizeRequest::getResponseType() const
|
||||||
|
{
|
||||||
|
return m_Response_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::setResponseType(const std::shared_ptr<ResponseType> &value)
|
||||||
|
{
|
||||||
|
m_Response_type = value;
|
||||||
|
m_Response_typeIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AuthorizeRequest::responseTypeIsSet() const
|
||||||
|
{
|
||||||
|
return m_Response_typeIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::unsetResponse_type()
|
||||||
|
{
|
||||||
|
m_Response_typeIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t AuthorizeRequest::getClientId() const
|
||||||
|
{
|
||||||
|
return m_Client_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::setClientId(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Client_id = value;
|
||||||
|
m_Client_idIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AuthorizeRequest::clientIdIsSet() const
|
||||||
|
{
|
||||||
|
return m_Client_idIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::unsetClient_id()
|
||||||
|
{
|
||||||
|
m_Client_idIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t AuthorizeRequest::getCodeChallenge() const
|
||||||
|
{
|
||||||
|
return m_Code_challenge;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::setCodeChallenge(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Code_challenge = value;
|
||||||
|
m_Code_challengeIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AuthorizeRequest::codeChallengeIsSet() const
|
||||||
|
{
|
||||||
|
return m_Code_challengeIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::unsetCode_challenge()
|
||||||
|
{
|
||||||
|
m_Code_challengeIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<CodeChallengeMethod> AuthorizeRequest::getCodeChallengeMethod() const
|
||||||
|
{
|
||||||
|
return m_Code_challenge_method;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::setCodeChallengeMethod(const std::shared_ptr<CodeChallengeMethod> &value)
|
||||||
|
{
|
||||||
|
m_Code_challenge_method = value;
|
||||||
|
m_Code_challenge_methodIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AuthorizeRequest::codeChallengeMethodIsSet() const
|
||||||
|
{
|
||||||
|
return m_Code_challenge_methodIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::unsetCode_challenge_method()
|
||||||
|
{
|
||||||
|
m_Code_challenge_methodIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t AuthorizeRequest::getRedirectUri() const
|
||||||
|
{
|
||||||
|
return m_Redirect_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::setRedirectUri(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Redirect_uri = value;
|
||||||
|
m_Redirect_uriIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AuthorizeRequest::redirectUriIsSet() const
|
||||||
|
{
|
||||||
|
return m_Redirect_uriIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::unsetRedirect_uri()
|
||||||
|
{
|
||||||
|
m_Redirect_uriIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t AuthorizeRequest::getScope() const
|
||||||
|
{
|
||||||
|
return m_Scope;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::setScope(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Scope = value;
|
||||||
|
m_ScopeIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AuthorizeRequest::scopeIsSet() const
|
||||||
|
{
|
||||||
|
return m_ScopeIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::unsetScope()
|
||||||
|
{
|
||||||
|
m_ScopeIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t AuthorizeRequest::getState() const
|
||||||
|
{
|
||||||
|
return m_State;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::setState(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_State = value;
|
||||||
|
m_StateIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AuthorizeRequest::stateIsSet() const
|
||||||
|
{
|
||||||
|
return m_StateIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AuthorizeRequest::unsetState()
|
||||||
|
{
|
||||||
|
m_StateIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_Response_typeIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("response_type")), m_Response_type));
|
|
||||||
}
|
|
||||||
if(m_Client_idIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("client_id")), m_Client_id));
|
|
||||||
}
|
|
||||||
if(m_Code_challengeIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code_challenge")), m_Code_challenge));
|
|
||||||
}
|
|
||||||
if(m_Code_challenge_methodIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("code_challenge_method")), m_Code_challenge_method));
|
|
||||||
}
|
|
||||||
if(m_Redirect_uriIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("redirect_uri")), m_Redirect_uri));
|
|
||||||
}
|
|
||||||
if(m_ScopeIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("scope")), m_Scope));
|
|
||||||
}
|
|
||||||
if(m_StateIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("state")), m_State));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AuthorizeRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("response_type"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<ResponseType> refVal_setResponseType;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("response_type"))), refVal_setResponseType );
|
|
||||||
setResponseType(refVal_setResponseType);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("client_id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setClientId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("client_id"))), refVal_setClientId );
|
|
||||||
setClientId(refVal_setClientId);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("code_challenge"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setCodeChallenge;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code_challenge"))), refVal_setCodeChallenge );
|
|
||||||
setCodeChallenge(refVal_setCodeChallenge);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("code_challenge_method"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<CodeChallengeMethod> refVal_setCodeChallengeMethod;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code_challenge_method"))), refVal_setCodeChallengeMethod );
|
|
||||||
setCodeChallengeMethod(refVal_setCodeChallengeMethod);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("redirect_uri"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setRedirectUri;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("redirect_uri"))), refVal_setRedirectUri );
|
|
||||||
setRedirectUri(refVal_setRedirectUri);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("scope"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setScope;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("scope"))), refVal_setScope );
|
|
||||||
setScope(refVal_setScope);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("state"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setState;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("state"))), refVal_setState );
|
|
||||||
setState(refVal_setState);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<ResponseType> AuthorizeRequest::getResponseType() const
|
|
||||||
{
|
|
||||||
return m_Response_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AuthorizeRequest::setResponseType(const std::shared_ptr<ResponseType>& value)
|
|
||||||
{
|
|
||||||
m_Response_type = value;
|
|
||||||
m_Response_typeIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::responseTypeIsSet() const
|
|
||||||
{
|
|
||||||
return m_Response_typeIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::unsetResponse_type()
|
|
||||||
{
|
|
||||||
m_Response_typeIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t AuthorizeRequest::getClientId() const
|
|
||||||
{
|
|
||||||
return m_Client_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AuthorizeRequest::setClientId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Client_id = value;
|
|
||||||
m_Client_idIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::clientIdIsSet() const
|
|
||||||
{
|
|
||||||
return m_Client_idIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::unsetClient_id()
|
|
||||||
{
|
|
||||||
m_Client_idIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t AuthorizeRequest::getCodeChallenge() const
|
|
||||||
{
|
|
||||||
return m_Code_challenge;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AuthorizeRequest::setCodeChallenge(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Code_challenge = value;
|
|
||||||
m_Code_challengeIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::codeChallengeIsSet() const
|
|
||||||
{
|
|
||||||
return m_Code_challengeIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::unsetCode_challenge()
|
|
||||||
{
|
|
||||||
m_Code_challengeIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<CodeChallengeMethod> AuthorizeRequest::getCodeChallengeMethod() const
|
|
||||||
{
|
|
||||||
return m_Code_challenge_method;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AuthorizeRequest::setCodeChallengeMethod(const std::shared_ptr<CodeChallengeMethod>& value)
|
|
||||||
{
|
|
||||||
m_Code_challenge_method = value;
|
|
||||||
m_Code_challenge_methodIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::codeChallengeMethodIsSet() const
|
|
||||||
{
|
|
||||||
return m_Code_challenge_methodIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::unsetCode_challenge_method()
|
|
||||||
{
|
|
||||||
m_Code_challenge_methodIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t AuthorizeRequest::getRedirectUri() const
|
|
||||||
{
|
|
||||||
return m_Redirect_uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AuthorizeRequest::setRedirectUri(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Redirect_uri = value;
|
|
||||||
m_Redirect_uriIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::redirectUriIsSet() const
|
|
||||||
{
|
|
||||||
return m_Redirect_uriIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::unsetRedirect_uri()
|
|
||||||
{
|
|
||||||
m_Redirect_uriIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t AuthorizeRequest::getScope() const
|
|
||||||
{
|
|
||||||
return m_Scope;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AuthorizeRequest::setScope(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Scope = value;
|
|
||||||
m_ScopeIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::scopeIsSet() const
|
|
||||||
{
|
|
||||||
return m_ScopeIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::unsetScope()
|
|
||||||
{
|
|
||||||
m_ScopeIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t AuthorizeRequest::getState() const
|
|
||||||
{
|
|
||||||
return m_State;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AuthorizeRequest::setState(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_State = value;
|
|
||||||
m_StateIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AuthorizeRequest::stateIsSet() const
|
|
||||||
{
|
|
||||||
return m_StateIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthorizeRequest::unsetState()
|
|
||||||
{
|
|
||||||
m_StateIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,109 +10,109 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/CodeChallengeMethod.h"
|
#include "tribufu++/model/CodeChallengeMethod.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
CodeChallengeMethod::eCodeChallengeMethod toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("plain")))
|
|
||||||
return CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_PLAIN;
|
|
||||||
if (val == utility::conversions::to_string_t(U("S256")))
|
|
||||||
return CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_S256;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(CodeChallengeMethod::eCodeChallengeMethod e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_PLAIN:
|
|
||||||
return U("plain");
|
|
||||||
case CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_S256:
|
|
||||||
return U("S256");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CodeChallengeMethod::CodeChallengeMethod()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CodeChallengeMethod::~CodeChallengeMethod()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void CodeChallengeMethod::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value CodeChallengeMethod::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CodeChallengeMethod::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CodeChallengeMethod::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CodeChallengeMethod::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
CodeChallengeMethod::eCodeChallengeMethod toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("plain")))
|
||||||
|
return CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_PLAIN;
|
||||||
|
if (val == utility::conversions::to_string_t(U("S256")))
|
||||||
|
return CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_S256;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(CodeChallengeMethod::eCodeChallengeMethod e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_PLAIN:
|
||||||
|
return U("plain");
|
||||||
|
case CodeChallengeMethod::eCodeChallengeMethod::CodeChallengeMethod_S256:
|
||||||
|
return U("S256");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CodeChallengeMethod::CodeChallengeMethod()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeChallengeMethod::~CodeChallengeMethod()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeChallengeMethod::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value CodeChallengeMethod::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CodeChallengeMethod::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeChallengeMethod::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CodeChallengeMethod::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeChallengeMethod::eCodeChallengeMethod CodeChallengeMethod::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeChallengeMethod::setValue(CodeChallengeMethod::eCodeChallengeMethod const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeChallengeMethod::eCodeChallengeMethod CodeChallengeMethod::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CodeChallengeMethod::setValue(CodeChallengeMethod::eCodeChallengeMethod const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,161 +10,162 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/CryptoViewModel.h"
|
#include "tribufu++/model/CryptoViewModel.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
CryptoViewModel::CryptoViewModel()
|
|
||||||
{
|
{
|
||||||
m_Encoded = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_EncodedIsSet = false;
|
|
||||||
m_Decoded = utility::conversions::to_string_t("");
|
|
||||||
m_DecodedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
CryptoViewModel::~CryptoViewModel()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void CryptoViewModel::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value CryptoViewModel::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_EncodedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("encoded"))] = ModelBase::toJson(m_Encoded);
|
|
||||||
}
|
|
||||||
if(m_DecodedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("decoded"))] = ModelBase::toJson(m_Decoded);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CryptoViewModel::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("encoded"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("encoded")));
|
|
||||||
if(!fieldValue.is_null())
|
CryptoViewModel::CryptoViewModel()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setEncoded;
|
m_Encoded = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setEncoded);
|
m_EncodedIsSet = false;
|
||||||
setEncoded(refVal_setEncoded);
|
m_Decoded = utility::conversions::to_string_t("");
|
||||||
|
m_DecodedIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("decoded"))))
|
CryptoViewModel::~CryptoViewModel()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("decoded")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setDecoded;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setDecoded);
|
|
||||||
setDecoded(refVal_setDecoded);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CryptoViewModel::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
void CryptoViewModel::validate()
|
||||||
{
|
{
|
||||||
utility::string_t namePrefix = prefix;
|
// TODO: implement validation
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
}
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
web::json::value CryptoViewModel::toJson() const
|
||||||
}
|
{
|
||||||
if(m_EncodedIsSet)
|
web::json::value val = web::json::value::object();
|
||||||
{
|
if (m_EncodedIsSet)
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("encoded")), m_Encoded));
|
{
|
||||||
}
|
|
||||||
if(m_DecodedIsSet)
|
val[utility::conversions::to_string_t(U("encoded"))] = ModelBase::toJson(m_Encoded);
|
||||||
{
|
}
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("decoded")), m_Decoded));
|
if (m_DecodedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("decoded"))] = ModelBase::toJson(m_Decoded);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CryptoViewModel::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("encoded"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("encoded")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setEncoded;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setEncoded);
|
||||||
|
setEncoded(refVal_setEncoded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("decoded"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("decoded")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDecoded;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setDecoded);
|
||||||
|
setDecoded(refVal_setDecoded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CryptoViewModel::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_EncodedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("encoded")), m_Encoded));
|
||||||
|
}
|
||||||
|
if (m_DecodedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("decoded")), m_Decoded));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CryptoViewModel::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("encoded"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setEncoded;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("encoded"))),
|
||||||
|
refVal_setEncoded);
|
||||||
|
setEncoded(refVal_setEncoded);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("decoded"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDecoded;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("decoded"))),
|
||||||
|
refVal_setDecoded);
|
||||||
|
setDecoded(refVal_setDecoded);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t CryptoViewModel::getEncoded() const
|
||||||
|
{
|
||||||
|
return m_Encoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CryptoViewModel::setEncoded(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Encoded = value;
|
||||||
|
m_EncodedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CryptoViewModel::encodedIsSet() const
|
||||||
|
{
|
||||||
|
return m_EncodedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CryptoViewModel::unsetEncoded()
|
||||||
|
{
|
||||||
|
m_EncodedIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t CryptoViewModel::getDecoded() const
|
||||||
|
{
|
||||||
|
return m_Decoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CryptoViewModel::setDecoded(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Decoded = value;
|
||||||
|
m_DecodedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CryptoViewModel::decodedIsSet() const
|
||||||
|
{
|
||||||
|
return m_DecodedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CryptoViewModel::unsetDecoded()
|
||||||
|
{
|
||||||
|
m_DecodedIsSet = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CryptoViewModel::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("encoded"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setEncoded;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("encoded"))), refVal_setEncoded );
|
|
||||||
setEncoded(refVal_setEncoded);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("decoded"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setDecoded;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("decoded"))), refVal_setDecoded );
|
|
||||||
setDecoded(refVal_setDecoded);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t CryptoViewModel::getEncoded() const
|
|
||||||
{
|
|
||||||
return m_Encoded;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CryptoViewModel::setEncoded(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Encoded = value;
|
|
||||||
m_EncodedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CryptoViewModel::encodedIsSet() const
|
|
||||||
{
|
|
||||||
return m_EncodedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CryptoViewModel::unsetEncoded()
|
|
||||||
{
|
|
||||||
m_EncodedIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t CryptoViewModel::getDecoded() const
|
|
||||||
{
|
|
||||||
return m_Decoded;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CryptoViewModel::setDecoded(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Decoded = value;
|
|
||||||
m_DecodedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CryptoViewModel::decodedIsSet() const
|
|
||||||
{
|
|
||||||
return m_DecodedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CryptoViewModel::unsetDecoded()
|
|
||||||
{
|
|
||||||
m_DecodedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
3016
src/model/Game.cpp
3016
src/model/Game.cpp
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -10,117 +10,115 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/GrantType.h"
|
#include "tribufu++/model/GrantType.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
GrantType::eGrantType toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("authorization_code")))
|
|
||||||
return GrantType::eGrantType::GrantType_AUTHORIZATION_CODE;
|
|
||||||
if (val == utility::conversions::to_string_t(U("client_credentials")))
|
|
||||||
return GrantType::eGrantType::GrantType_CLIENT_CREDENTIALS;
|
|
||||||
if (val == utility::conversions::to_string_t(U("password")))
|
|
||||||
return GrantType::eGrantType::GrantType_PASSWORD;
|
|
||||||
if (val == utility::conversions::to_string_t(U("refresh_token")))
|
|
||||||
return GrantType::eGrantType::GrantType_REFRESH_TOKEN;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(GrantType::eGrantType e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case GrantType::eGrantType::GrantType_AUTHORIZATION_CODE:
|
|
||||||
return U("authorization_code");
|
|
||||||
case GrantType::eGrantType::GrantType_CLIENT_CREDENTIALS:
|
|
||||||
return U("client_credentials");
|
|
||||||
case GrantType::eGrantType::GrantType_PASSWORD:
|
|
||||||
return U("password");
|
|
||||||
case GrantType::eGrantType::GrantType_REFRESH_TOKEN:
|
|
||||||
return U("refresh_token");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GrantType::GrantType()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
GrantType::~GrantType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrantType::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value GrantType::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GrantType::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrantType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GrantType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
GrantType::eGrantType toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("authorization_code")))
|
||||||
|
return GrantType::eGrantType::GrantType_AUTHORIZATION_CODE;
|
||||||
|
if (val == utility::conversions::to_string_t(U("client_credentials")))
|
||||||
|
return GrantType::eGrantType::GrantType_CLIENT_CREDENTIALS;
|
||||||
|
if (val == utility::conversions::to_string_t(U("password")))
|
||||||
|
return GrantType::eGrantType::GrantType_PASSWORD;
|
||||||
|
if (val == utility::conversions::to_string_t(U("refresh_token")))
|
||||||
|
return GrantType::eGrantType::GrantType_REFRESH_TOKEN;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(GrantType::eGrantType e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case GrantType::eGrantType::GrantType_AUTHORIZATION_CODE:
|
||||||
|
return U("authorization_code");
|
||||||
|
case GrantType::eGrantType::GrantType_CLIENT_CREDENTIALS:
|
||||||
|
return U("client_credentials");
|
||||||
|
case GrantType::eGrantType::GrantType_PASSWORD:
|
||||||
|
return U("password");
|
||||||
|
case GrantType::eGrantType::GrantType_REFRESH_TOKEN:
|
||||||
|
return U("refresh_token");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GrantType::GrantType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
GrantType::~GrantType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void GrantType::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value GrantType::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GrantType::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GrantType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GrantType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GrantType::eGrantType GrantType::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GrantType::setValue(GrantType::eGrantType const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GrantType::eGrantType GrantType::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrantType::setValue(GrantType::eGrantType const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
1603
src/model/Group.cpp
1603
src/model/Group.cpp
File diff suppressed because it is too large
Load Diff
@ -10,403 +10,403 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/GroupGame.h"
|
#include "tribufu++/model/GroupGame.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
GroupGame::GroupGame()
|
|
||||||
{
|
{
|
||||||
m_Group_id = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_Group_idIsSet = false;
|
|
||||||
m_GroupIsSet = false;
|
|
||||||
m_Application_id = utility::conversions::to_string_t("");
|
|
||||||
m_Application_idIsSet = false;
|
|
||||||
m_ApplicationIsSet = false;
|
|
||||||
m_StatsIsSet = false;
|
|
||||||
m_Acquired = utility::datetime();
|
|
||||||
m_AcquiredIsSet = false;
|
|
||||||
m_Last_used = utility::datetime();
|
|
||||||
m_Last_usedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupGame::~GroupGame()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value GroupGame::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_Group_idIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("group_id"))] = ModelBase::toJson(m_Group_id);
|
|
||||||
}
|
|
||||||
if(m_GroupIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("group"))] = ModelBase::toJson(m_Group);
|
|
||||||
}
|
|
||||||
if(m_Application_idIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("application_id"))] = ModelBase::toJson(m_Application_id);
|
|
||||||
}
|
|
||||||
if(m_ApplicationIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("application"))] = ModelBase::toJson(m_Application);
|
|
||||||
}
|
|
||||||
if(m_StatsIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("stats"))] = ModelBase::toJson(m_Stats);
|
|
||||||
}
|
|
||||||
if(m_AcquiredIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("acquired"))] = ModelBase::toJson(m_Acquired);
|
|
||||||
}
|
|
||||||
if(m_Last_usedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("last_used"))] = ModelBase::toJson(m_Last_used);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("group_id"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("group_id")));
|
|
||||||
if(!fieldValue.is_null())
|
GroupGame::GroupGame()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setGroupId;
|
m_Group_id = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setGroupId);
|
m_Group_idIsSet = false;
|
||||||
setGroupId(refVal_setGroupId);
|
m_GroupIsSet = false;
|
||||||
|
m_Application_id = utility::conversions::to_string_t("");
|
||||||
|
m_Application_idIsSet = false;
|
||||||
|
m_ApplicationIsSet = false;
|
||||||
|
m_StatsIsSet = false;
|
||||||
|
m_Acquired = utility::datetime();
|
||||||
|
m_AcquiredIsSet = false;
|
||||||
|
m_Last_used = utility::datetime();
|
||||||
|
m_Last_usedIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("group"))))
|
GroupGame::~GroupGame()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("group")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<Group> refVal_setGroup;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setGroup);
|
|
||||||
setGroup(refVal_setGroup);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("application_id"))))
|
void GroupGame::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("application_id")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setApplicationId;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setApplicationId);
|
|
||||||
setApplicationId(refVal_setApplicationId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("application"))))
|
web::json::value GroupGame::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("application")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<Application> refVal_setApplication;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setApplication);
|
if (m_Group_idIsSet)
|
||||||
setApplication(refVal_setApplication);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("group_id"))] = ModelBase::toJson(m_Group_id);
|
||||||
|
}
|
||||||
|
if (m_GroupIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("group"))] = ModelBase::toJson(m_Group);
|
||||||
|
}
|
||||||
|
if (m_Application_idIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("application_id"))] = ModelBase::toJson(m_Application_id);
|
||||||
|
}
|
||||||
|
if (m_ApplicationIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("application"))] = ModelBase::toJson(m_Application);
|
||||||
|
}
|
||||||
|
if (m_StatsIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("stats"))] = ModelBase::toJson(m_Stats);
|
||||||
|
}
|
||||||
|
if (m_AcquiredIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("acquired"))] = ModelBase::toJson(m_Acquired);
|
||||||
|
}
|
||||||
|
if (m_Last_usedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("last_used"))] = ModelBase::toJson(m_Last_used);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("stats"))))
|
bool GroupGame::fromJson(const web::json::value &val)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("stats")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<AnyType> refVal_setStats;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setStats);
|
if (val.has_field(utility::conversions::to_string_t(U("group_id"))))
|
||||||
setStats(refVal_setStats);
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("group_id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setGroupId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setGroupId);
|
||||||
|
setGroupId(refVal_setGroupId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("group"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("group")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<Group> refVal_setGroup;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setGroup);
|
||||||
|
setGroup(refVal_setGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("application_id"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("application_id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setApplicationId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setApplicationId);
|
||||||
|
setApplicationId(refVal_setApplicationId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("application"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("application")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<Application> refVal_setApplication;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setApplication);
|
||||||
|
setApplication(refVal_setApplication);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("stats"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("stats")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<AnyType> refVal_setStats;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setStats);
|
||||||
|
setStats(refVal_setStats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("acquired"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("acquired")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setAcquired;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setAcquired);
|
||||||
|
setAcquired(refVal_setAcquired);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("last_used"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("last_used")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setLastUsed;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setLastUsed);
|
||||||
|
setLastUsed(refVal_setLastUsed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("acquired"))))
|
void GroupGame::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("acquired")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setAcquired;
|
utility::string_t namePrefix = prefix;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setAcquired);
|
if (namePrefix.size() > 0 &&
|
||||||
setAcquired(refVal_setAcquired);
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_Group_idIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("group_id")),
|
||||||
|
m_Group_id));
|
||||||
|
}
|
||||||
|
if (m_GroupIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("group")), m_Group));
|
||||||
|
}
|
||||||
|
if (m_Application_idIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("application_id")), m_Application_id));
|
||||||
|
}
|
||||||
|
if (m_ApplicationIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("application")), m_Application));
|
||||||
|
}
|
||||||
|
if (m_StatsIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("stats")), m_Stats));
|
||||||
|
}
|
||||||
|
if (m_AcquiredIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("acquired")),
|
||||||
|
m_Acquired));
|
||||||
|
}
|
||||||
|
if (m_Last_usedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("last_used")),
|
||||||
|
m_Last_used));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("last_used"))))
|
bool GroupGame::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("last_used")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setLastUsed;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLastUsed);
|
utility::string_t namePrefix = prefix;
|
||||||
setLastUsed(refVal_setLastUsed);
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("group_id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setGroupId;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("group_id"))), refVal_setGroupId);
|
||||||
|
setGroupId(refVal_setGroupId);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("group"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<Group> refVal_setGroup;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("group"))),
|
||||||
|
refVal_setGroup);
|
||||||
|
setGroup(refVal_setGroup);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("application_id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setApplicationId;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("application_id"))),
|
||||||
|
refVal_setApplicationId);
|
||||||
|
setApplicationId(refVal_setApplicationId);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("application"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<Application> refVal_setApplication;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("application"))), refVal_setApplication);
|
||||||
|
setApplication(refVal_setApplication);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("stats"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<AnyType> refVal_setStats;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("stats"))),
|
||||||
|
refVal_setStats);
|
||||||
|
setStats(refVal_setStats);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("acquired"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setAcquired;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("acquired"))), refVal_setAcquired);
|
||||||
|
setAcquired(refVal_setAcquired);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("last_used"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setLastUsed;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("last_used"))), refVal_setLastUsed);
|
||||||
|
setLastUsed(refVal_setLastUsed);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t GroupGame::getGroupId() const
|
||||||
|
{
|
||||||
|
return m_Group_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::setGroupId(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Group_id = value;
|
||||||
|
m_Group_idIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupGame::groupIdIsSet() const
|
||||||
|
{
|
||||||
|
return m_Group_idIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::unsetGroup_id()
|
||||||
|
{
|
||||||
|
m_Group_idIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<Group> GroupGame::getGroup() const
|
||||||
|
{
|
||||||
|
return m_Group;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::setGroup(const std::shared_ptr<Group> &value)
|
||||||
|
{
|
||||||
|
m_Group = value;
|
||||||
|
m_GroupIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupGame::groupIsSet() const
|
||||||
|
{
|
||||||
|
return m_GroupIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::unsetGroup()
|
||||||
|
{
|
||||||
|
m_GroupIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t GroupGame::getApplicationId() const
|
||||||
|
{
|
||||||
|
return m_Application_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::setApplicationId(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Application_id = value;
|
||||||
|
m_Application_idIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupGame::applicationIdIsSet() const
|
||||||
|
{
|
||||||
|
return m_Application_idIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::unsetApplication_id()
|
||||||
|
{
|
||||||
|
m_Application_idIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<Application> GroupGame::getApplication() const
|
||||||
|
{
|
||||||
|
return m_Application;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::setApplication(const std::shared_ptr<Application> &value)
|
||||||
|
{
|
||||||
|
m_Application = value;
|
||||||
|
m_ApplicationIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupGame::applicationIsSet() const
|
||||||
|
{
|
||||||
|
return m_ApplicationIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::unsetApplication()
|
||||||
|
{
|
||||||
|
m_ApplicationIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<AnyType> GroupGame::getStats() const
|
||||||
|
{
|
||||||
|
return m_Stats;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::setStats(const std::shared_ptr<AnyType> &value)
|
||||||
|
{
|
||||||
|
m_Stats = value;
|
||||||
|
m_StatsIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupGame::statsIsSet() const
|
||||||
|
{
|
||||||
|
return m_StatsIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::unsetStats()
|
||||||
|
{
|
||||||
|
m_StatsIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime GroupGame::getAcquired() const
|
||||||
|
{
|
||||||
|
return m_Acquired;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::setAcquired(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Acquired = value;
|
||||||
|
m_AcquiredIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupGame::acquiredIsSet() const
|
||||||
|
{
|
||||||
|
return m_AcquiredIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::unsetAcquired()
|
||||||
|
{
|
||||||
|
m_AcquiredIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime GroupGame::getLastUsed() const
|
||||||
|
{
|
||||||
|
return m_Last_used;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::setLastUsed(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Last_used = value;
|
||||||
|
m_Last_usedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupGame::lastUsedIsSet() const
|
||||||
|
{
|
||||||
|
return m_Last_usedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupGame::unsetLast_used()
|
||||||
|
{
|
||||||
|
m_Last_usedIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_Group_idIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("group_id")), m_Group_id));
|
|
||||||
}
|
|
||||||
if(m_GroupIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("group")), m_Group));
|
|
||||||
}
|
|
||||||
if(m_Application_idIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("application_id")), m_Application_id));
|
|
||||||
}
|
|
||||||
if(m_ApplicationIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("application")), m_Application));
|
|
||||||
}
|
|
||||||
if(m_StatsIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("stats")), m_Stats));
|
|
||||||
}
|
|
||||||
if(m_AcquiredIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("acquired")), m_Acquired));
|
|
||||||
}
|
|
||||||
if(m_Last_usedIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("last_used")), m_Last_used));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GroupGame::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("group_id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setGroupId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("group_id"))), refVal_setGroupId );
|
|
||||||
setGroupId(refVal_setGroupId);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("group"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<Group> refVal_setGroup;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("group"))), refVal_setGroup );
|
|
||||||
setGroup(refVal_setGroup);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("application_id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setApplicationId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("application_id"))), refVal_setApplicationId );
|
|
||||||
setApplicationId(refVal_setApplicationId);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("application"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<Application> refVal_setApplication;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("application"))), refVal_setApplication );
|
|
||||||
setApplication(refVal_setApplication);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("stats"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<AnyType> refVal_setStats;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("stats"))), refVal_setStats );
|
|
||||||
setStats(refVal_setStats);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("acquired"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setAcquired;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("acquired"))), refVal_setAcquired );
|
|
||||||
setAcquired(refVal_setAcquired);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("last_used"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setLastUsed;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("last_used"))), refVal_setLastUsed );
|
|
||||||
setLastUsed(refVal_setLastUsed);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t GroupGame::getGroupId() const
|
|
||||||
{
|
|
||||||
return m_Group_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupGame::setGroupId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Group_id = value;
|
|
||||||
m_Group_idIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::groupIdIsSet() const
|
|
||||||
{
|
|
||||||
return m_Group_idIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::unsetGroup_id()
|
|
||||||
{
|
|
||||||
m_Group_idIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<Group> GroupGame::getGroup() const
|
|
||||||
{
|
|
||||||
return m_Group;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupGame::setGroup(const std::shared_ptr<Group>& value)
|
|
||||||
{
|
|
||||||
m_Group = value;
|
|
||||||
m_GroupIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::groupIsSet() const
|
|
||||||
{
|
|
||||||
return m_GroupIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::unsetGroup()
|
|
||||||
{
|
|
||||||
m_GroupIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t GroupGame::getApplicationId() const
|
|
||||||
{
|
|
||||||
return m_Application_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupGame::setApplicationId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Application_id = value;
|
|
||||||
m_Application_idIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::applicationIdIsSet() const
|
|
||||||
{
|
|
||||||
return m_Application_idIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::unsetApplication_id()
|
|
||||||
{
|
|
||||||
m_Application_idIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<Application> GroupGame::getApplication() const
|
|
||||||
{
|
|
||||||
return m_Application;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupGame::setApplication(const std::shared_ptr<Application>& value)
|
|
||||||
{
|
|
||||||
m_Application = value;
|
|
||||||
m_ApplicationIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::applicationIsSet() const
|
|
||||||
{
|
|
||||||
return m_ApplicationIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::unsetApplication()
|
|
||||||
{
|
|
||||||
m_ApplicationIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<AnyType> GroupGame::getStats() const
|
|
||||||
{
|
|
||||||
return m_Stats;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupGame::setStats(const std::shared_ptr<AnyType>& value)
|
|
||||||
{
|
|
||||||
m_Stats = value;
|
|
||||||
m_StatsIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::statsIsSet() const
|
|
||||||
{
|
|
||||||
return m_StatsIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::unsetStats()
|
|
||||||
{
|
|
||||||
m_StatsIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime GroupGame::getAcquired() const
|
|
||||||
{
|
|
||||||
return m_Acquired;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupGame::setAcquired(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Acquired = value;
|
|
||||||
m_AcquiredIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::acquiredIsSet() const
|
|
||||||
{
|
|
||||||
return m_AcquiredIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::unsetAcquired()
|
|
||||||
{
|
|
||||||
m_AcquiredIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime GroupGame::getLastUsed() const
|
|
||||||
{
|
|
||||||
return m_Last_used;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupGame::setLastUsed(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Last_used = value;
|
|
||||||
m_Last_usedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupGame::lastUsedIsSet() const
|
|
||||||
{
|
|
||||||
return m_Last_usedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupGame::unsetLast_used()
|
|
||||||
{
|
|
||||||
m_Last_usedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,502 +10,502 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/GroupMember.h"
|
#include "tribufu++/model/GroupMember.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
GroupMember::GroupMember()
|
|
||||||
{
|
{
|
||||||
m_Id = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_IdIsSet = false;
|
|
||||||
m_Uuid = utility::conversions::to_string_t("");
|
|
||||||
m_UuidIsSet = false;
|
|
||||||
m_Name = utility::conversions::to_string_t("");
|
|
||||||
m_NameIsSet = false;
|
|
||||||
m_Display_name = utility::conversions::to_string_t("");
|
|
||||||
m_Display_nameIsSet = false;
|
|
||||||
m_Verified = false;
|
|
||||||
m_VerifiedIsSet = false;
|
|
||||||
m_Photo_url = utility::conversions::to_string_t("");
|
|
||||||
m_Photo_urlIsSet = false;
|
|
||||||
m_Last_online = utility::datetime();
|
|
||||||
m_Last_onlineIsSet = false;
|
|
||||||
m_RankIsSet = false;
|
|
||||||
m_Since = utility::datetime();
|
|
||||||
m_SinceIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupMember::~GroupMember()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value GroupMember::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_IdIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
|
||||||
}
|
|
||||||
if(m_UuidIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("uuid"))] = ModelBase::toJson(m_Uuid);
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
|
||||||
}
|
|
||||||
if(m_Display_nameIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("display_name"))] = ModelBase::toJson(m_Display_name);
|
|
||||||
}
|
|
||||||
if(m_VerifiedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("verified"))] = ModelBase::toJson(m_Verified);
|
|
||||||
}
|
|
||||||
if(m_Photo_urlIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("photo_url"))] = ModelBase::toJson(m_Photo_url);
|
|
||||||
}
|
|
||||||
if(m_Last_onlineIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("last_online"))] = ModelBase::toJson(m_Last_online);
|
|
||||||
}
|
|
||||||
if(m_RankIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("rank"))] = ModelBase::toJson(m_Rank);
|
|
||||||
}
|
|
||||||
if(m_SinceIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("since"))] = ModelBase::toJson(m_Since);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("id"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
|
|
||||||
if(!fieldValue.is_null())
|
GroupMember::GroupMember()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setId;
|
m_Id = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
m_IdIsSet = false;
|
||||||
setId(refVal_setId);
|
m_Uuid = utility::conversions::to_string_t("");
|
||||||
|
m_UuidIsSet = false;
|
||||||
|
m_Name = utility::conversions::to_string_t("");
|
||||||
|
m_NameIsSet = false;
|
||||||
|
m_Display_name = utility::conversions::to_string_t("");
|
||||||
|
m_Display_nameIsSet = false;
|
||||||
|
m_Verified = false;
|
||||||
|
m_VerifiedIsSet = false;
|
||||||
|
m_Photo_url = utility::conversions::to_string_t("");
|
||||||
|
m_Photo_urlIsSet = false;
|
||||||
|
m_Last_online = utility::datetime();
|
||||||
|
m_Last_onlineIsSet = false;
|
||||||
|
m_RankIsSet = false;
|
||||||
|
m_Since = utility::datetime();
|
||||||
|
m_SinceIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("uuid"))))
|
GroupMember::~GroupMember()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("uuid")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setUuid;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUuid);
|
|
||||||
setUuid(refVal_setUuid);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
void GroupMember::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setName;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
|
||||||
setName(refVal_setName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("display_name"))))
|
web::json::value GroupMember::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("display_name")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setDisplayName;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setDisplayName);
|
if (m_IdIsSet)
|
||||||
setDisplayName(refVal_setDisplayName);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||||
|
}
|
||||||
|
if (m_UuidIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("uuid"))] = ModelBase::toJson(m_Uuid);
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||||
|
}
|
||||||
|
if (m_Display_nameIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("display_name"))] = ModelBase::toJson(m_Display_name);
|
||||||
|
}
|
||||||
|
if (m_VerifiedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("verified"))] = ModelBase::toJson(m_Verified);
|
||||||
|
}
|
||||||
|
if (m_Photo_urlIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("photo_url"))] = ModelBase::toJson(m_Photo_url);
|
||||||
|
}
|
||||||
|
if (m_Last_onlineIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("last_online"))] = ModelBase::toJson(m_Last_online);
|
||||||
|
}
|
||||||
|
if (m_RankIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("rank"))] = ModelBase::toJson(m_Rank);
|
||||||
|
}
|
||||||
|
if (m_SinceIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("since"))] = ModelBase::toJson(m_Since);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("verified"))))
|
bool GroupMember::fromJson(const web::json::value &val)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("verified")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
bool refVal_setVerified;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setVerified);
|
if (val.has_field(utility::conversions::to_string_t(U("id"))))
|
||||||
setVerified(refVal_setVerified);
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||||
|
setId(refVal_setId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("uuid"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("uuid")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setUuid;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setUuid);
|
||||||
|
setUuid(refVal_setUuid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("display_name"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("display_name")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDisplayName;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setDisplayName);
|
||||||
|
setDisplayName(refVal_setDisplayName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("verified"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("verified")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
bool refVal_setVerified;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setVerified);
|
||||||
|
setVerified(refVal_setVerified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("photo_url"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("photo_url")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPhotoUrl;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrl);
|
||||||
|
setPhotoUrl(refVal_setPhotoUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("last_online"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("last_online")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setLastOnline;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setLastOnline);
|
||||||
|
setLastOnline(refVal_setLastOnline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("rank"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("rank")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<GroupRank> refVal_setRank;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setRank);
|
||||||
|
setRank(refVal_setRank);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("since"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("since")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setSince;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setSince);
|
||||||
|
setSince(refVal_setSince);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("photo_url"))))
|
void GroupMember::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
{
|
const utility::string_t &prefix) const
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("photo_url")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setPhotoUrl;
|
utility::string_t namePrefix = prefix;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrl);
|
if (namePrefix.size() > 0 &&
|
||||||
setPhotoUrl(refVal_setPhotoUrl);
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_IdIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||||
|
}
|
||||||
|
if (m_UuidIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("uuid")), m_Uuid));
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||||
|
}
|
||||||
|
if (m_Display_nameIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("display_name")), m_Display_name));
|
||||||
|
}
|
||||||
|
if (m_VerifiedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("verified")),
|
||||||
|
m_Verified));
|
||||||
|
}
|
||||||
|
if (m_Photo_urlIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photo_url")),
|
||||||
|
m_Photo_url));
|
||||||
|
}
|
||||||
|
if (m_Last_onlineIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("last_online")), m_Last_online));
|
||||||
|
}
|
||||||
|
if (m_RankIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("rank")), m_Rank));
|
||||||
|
}
|
||||||
|
if (m_SinceIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("since")), m_Since));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("last_online"))))
|
bool GroupMember::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("last_online")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setLastOnline;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLastOnline);
|
utility::string_t namePrefix = prefix;
|
||||||
setLastOnline(refVal_setLastOnline);
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setId;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))),
|
||||||
|
refVal_setId);
|
||||||
|
setId(refVal_setId);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("uuid"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setUuid;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("uuid"))),
|
||||||
|
refVal_setUuid);
|
||||||
|
setUuid(refVal_setUuid);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))),
|
||||||
|
refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("display_name"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDisplayName;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("display_name"))), refVal_setDisplayName);
|
||||||
|
setDisplayName(refVal_setDisplayName);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("verified"))))
|
||||||
|
{
|
||||||
|
bool refVal_setVerified;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("verified"))), refVal_setVerified);
|
||||||
|
setVerified(refVal_setVerified);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("photo_url"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPhotoUrl;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("photo_url"))), refVal_setPhotoUrl);
|
||||||
|
setPhotoUrl(refVal_setPhotoUrl);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("last_online"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setLastOnline;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("last_online"))), refVal_setLastOnline);
|
||||||
|
setLastOnline(refVal_setLastOnline);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("rank"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<GroupRank> refVal_setRank;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("rank"))),
|
||||||
|
refVal_setRank);
|
||||||
|
setRank(refVal_setRank);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("since"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setSince;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("since"))),
|
||||||
|
refVal_setSince);
|
||||||
|
setSince(refVal_setSince);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("rank"))))
|
utility::string_t GroupMember::getId() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("rank")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<GroupRank> refVal_setRank;
|
return m_Id;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRank);
|
|
||||||
setRank(refVal_setRank);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("since"))))
|
void GroupMember::setId(const utility::string_t &value)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("since")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setSince;
|
m_Id = value;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setSince);
|
m_IdIsSet = true;
|
||||||
setSince(refVal_setSince);
|
}
|
||||||
|
|
||||||
|
bool GroupMember::idIsSet() const
|
||||||
|
{
|
||||||
|
return m_IdIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetId()
|
||||||
|
{
|
||||||
|
m_IdIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t GroupMember::getUuid() const
|
||||||
|
{
|
||||||
|
return m_Uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setUuid(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Uuid = value;
|
||||||
|
m_UuidIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::uuidIsSet() const
|
||||||
|
{
|
||||||
|
return m_UuidIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetUuid()
|
||||||
|
{
|
||||||
|
m_UuidIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t GroupMember::getName() const
|
||||||
|
{
|
||||||
|
return m_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setName(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Name = value;
|
||||||
|
m_NameIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::nameIsSet() const
|
||||||
|
{
|
||||||
|
return m_NameIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetName()
|
||||||
|
{
|
||||||
|
m_NameIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t GroupMember::getDisplayName() const
|
||||||
|
{
|
||||||
|
return m_Display_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setDisplayName(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Display_name = value;
|
||||||
|
m_Display_nameIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::displayNameIsSet() const
|
||||||
|
{
|
||||||
|
return m_Display_nameIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetDisplay_name()
|
||||||
|
{
|
||||||
|
m_Display_nameIsSet = false;
|
||||||
|
}
|
||||||
|
bool GroupMember::isVerified() const
|
||||||
|
{
|
||||||
|
return m_Verified;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setVerified(bool value)
|
||||||
|
{
|
||||||
|
m_Verified = value;
|
||||||
|
m_VerifiedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::verifiedIsSet() const
|
||||||
|
{
|
||||||
|
return m_VerifiedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetVerified()
|
||||||
|
{
|
||||||
|
m_VerifiedIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t GroupMember::getPhotoUrl() const
|
||||||
|
{
|
||||||
|
return m_Photo_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setPhotoUrl(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Photo_url = value;
|
||||||
|
m_Photo_urlIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::photoUrlIsSet() const
|
||||||
|
{
|
||||||
|
return m_Photo_urlIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetPhoto_url()
|
||||||
|
{
|
||||||
|
m_Photo_urlIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime GroupMember::getLastOnline() const
|
||||||
|
{
|
||||||
|
return m_Last_online;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setLastOnline(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Last_online = value;
|
||||||
|
m_Last_onlineIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::lastOnlineIsSet() const
|
||||||
|
{
|
||||||
|
return m_Last_onlineIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetLast_online()
|
||||||
|
{
|
||||||
|
m_Last_onlineIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<GroupRank> GroupMember::getRank() const
|
||||||
|
{
|
||||||
|
return m_Rank;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setRank(const std::shared_ptr<GroupRank> &value)
|
||||||
|
{
|
||||||
|
m_Rank = value;
|
||||||
|
m_RankIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::rankIsSet() const
|
||||||
|
{
|
||||||
|
return m_RankIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetRank()
|
||||||
|
{
|
||||||
|
m_RankIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime GroupMember::getSince() const
|
||||||
|
{
|
||||||
|
return m_Since;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::setSince(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Since = value;
|
||||||
|
m_SinceIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupMember::sinceIsSet() const
|
||||||
|
{
|
||||||
|
return m_SinceIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupMember::unsetSince()
|
||||||
|
{
|
||||||
|
m_SinceIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_IdIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
|
||||||
}
|
|
||||||
if(m_UuidIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("uuid")), m_Uuid));
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
|
||||||
}
|
|
||||||
if(m_Display_nameIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("display_name")), m_Display_name));
|
|
||||||
}
|
|
||||||
if(m_VerifiedIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("verified")), m_Verified));
|
|
||||||
}
|
|
||||||
if(m_Photo_urlIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photo_url")), m_Photo_url));
|
|
||||||
}
|
|
||||||
if(m_Last_onlineIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("last_online")), m_Last_online));
|
|
||||||
}
|
|
||||||
if(m_RankIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("rank")), m_Rank));
|
|
||||||
}
|
|
||||||
if(m_SinceIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("since")), m_Since));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GroupMember::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
|
||||||
setId(refVal_setId);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("uuid"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setUuid;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("uuid"))), refVal_setUuid );
|
|
||||||
setUuid(refVal_setUuid);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
|
||||||
setName(refVal_setName);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("display_name"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setDisplayName;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("display_name"))), refVal_setDisplayName );
|
|
||||||
setDisplayName(refVal_setDisplayName);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("verified"))))
|
|
||||||
{
|
|
||||||
bool refVal_setVerified;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("verified"))), refVal_setVerified );
|
|
||||||
setVerified(refVal_setVerified);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("photo_url"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setPhotoUrl;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photo_url"))), refVal_setPhotoUrl );
|
|
||||||
setPhotoUrl(refVal_setPhotoUrl);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("last_online"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setLastOnline;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("last_online"))), refVal_setLastOnline );
|
|
||||||
setLastOnline(refVal_setLastOnline);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("rank"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<GroupRank> refVal_setRank;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("rank"))), refVal_setRank );
|
|
||||||
setRank(refVal_setRank);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("since"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setSince;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("since"))), refVal_setSince );
|
|
||||||
setSince(refVal_setSince);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t GroupMember::getId() const
|
|
||||||
{
|
|
||||||
return m_Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Id = value;
|
|
||||||
m_IdIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::idIsSet() const
|
|
||||||
{
|
|
||||||
return m_IdIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetId()
|
|
||||||
{
|
|
||||||
m_IdIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t GroupMember::getUuid() const
|
|
||||||
{
|
|
||||||
return m_Uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setUuid(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Uuid = value;
|
|
||||||
m_UuidIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::uuidIsSet() const
|
|
||||||
{
|
|
||||||
return m_UuidIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetUuid()
|
|
||||||
{
|
|
||||||
m_UuidIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t GroupMember::getName() const
|
|
||||||
{
|
|
||||||
return m_Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setName(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Name = value;
|
|
||||||
m_NameIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::nameIsSet() const
|
|
||||||
{
|
|
||||||
return m_NameIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetName()
|
|
||||||
{
|
|
||||||
m_NameIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t GroupMember::getDisplayName() const
|
|
||||||
{
|
|
||||||
return m_Display_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setDisplayName(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Display_name = value;
|
|
||||||
m_Display_nameIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::displayNameIsSet() const
|
|
||||||
{
|
|
||||||
return m_Display_nameIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetDisplay_name()
|
|
||||||
{
|
|
||||||
m_Display_nameIsSet = false;
|
|
||||||
}
|
|
||||||
bool GroupMember::isVerified() const
|
|
||||||
{
|
|
||||||
return m_Verified;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::setVerified(bool value)
|
|
||||||
{
|
|
||||||
m_Verified = value;
|
|
||||||
m_VerifiedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::verifiedIsSet() const
|
|
||||||
{
|
|
||||||
return m_VerifiedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetVerified()
|
|
||||||
{
|
|
||||||
m_VerifiedIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t GroupMember::getPhotoUrl() const
|
|
||||||
{
|
|
||||||
return m_Photo_url;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setPhotoUrl(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Photo_url = value;
|
|
||||||
m_Photo_urlIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::photoUrlIsSet() const
|
|
||||||
{
|
|
||||||
return m_Photo_urlIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetPhoto_url()
|
|
||||||
{
|
|
||||||
m_Photo_urlIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime GroupMember::getLastOnline() const
|
|
||||||
{
|
|
||||||
return m_Last_online;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setLastOnline(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Last_online = value;
|
|
||||||
m_Last_onlineIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::lastOnlineIsSet() const
|
|
||||||
{
|
|
||||||
return m_Last_onlineIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetLast_online()
|
|
||||||
{
|
|
||||||
m_Last_onlineIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<GroupRank> GroupMember::getRank() const
|
|
||||||
{
|
|
||||||
return m_Rank;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setRank(const std::shared_ptr<GroupRank>& value)
|
|
||||||
{
|
|
||||||
m_Rank = value;
|
|
||||||
m_RankIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::rankIsSet() const
|
|
||||||
{
|
|
||||||
return m_RankIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetRank()
|
|
||||||
{
|
|
||||||
m_RankIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime GroupMember::getSince() const
|
|
||||||
{
|
|
||||||
return m_Since;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GroupMember::setSince(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Since = value;
|
|
||||||
m_SinceIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupMember::sinceIsSet() const
|
|
||||||
{
|
|
||||||
return m_SinceIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupMember::unsetSince()
|
|
||||||
{
|
|
||||||
m_SinceIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,113 +10,111 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/GroupRank.h"
|
#include "tribufu++/model/GroupRank.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
GroupRank::eGroupRank toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("member")))
|
|
||||||
return GroupRank::eGroupRank::GroupRank_MEMBER;
|
|
||||||
if (val == utility::conversions::to_string_t(U("leader")))
|
|
||||||
return GroupRank::eGroupRank::GroupRank_LEADER;
|
|
||||||
if (val == utility::conversions::to_string_t(U("owner")))
|
|
||||||
return GroupRank::eGroupRank::GroupRank_OWNER;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(GroupRank::eGroupRank e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case GroupRank::eGroupRank::GroupRank_MEMBER:
|
|
||||||
return U("member");
|
|
||||||
case GroupRank::eGroupRank::GroupRank_LEADER:
|
|
||||||
return U("leader");
|
|
||||||
case GroupRank::eGroupRank::GroupRank_OWNER:
|
|
||||||
return U("owner");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupRank::GroupRank()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupRank::~GroupRank()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupRank::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value GroupRank::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupRank::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupRank::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GroupRank::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
GroupRank::eGroupRank toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("member")))
|
||||||
|
return GroupRank::eGroupRank::GroupRank_MEMBER;
|
||||||
|
if (val == utility::conversions::to_string_t(U("leader")))
|
||||||
|
return GroupRank::eGroupRank::GroupRank_LEADER;
|
||||||
|
if (val == utility::conversions::to_string_t(U("owner")))
|
||||||
|
return GroupRank::eGroupRank::GroupRank_OWNER;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(GroupRank::eGroupRank e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case GroupRank::eGroupRank::GroupRank_MEMBER:
|
||||||
|
return U("member");
|
||||||
|
case GroupRank::eGroupRank::GroupRank_LEADER:
|
||||||
|
return U("leader");
|
||||||
|
case GroupRank::eGroupRank::GroupRank_OWNER:
|
||||||
|
return U("owner");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GroupRank::GroupRank()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
GroupRank::~GroupRank()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupRank::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value GroupRank::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupRank::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupRank::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GroupRank::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GroupRank::eGroupRank GroupRank::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupRank::setValue(GroupRank::eGroupRank const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupRank::eGroupRank GroupRank::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupRank::setValue(GroupRank::eGroupRank const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,112 +10,112 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/HashViewModel.h"
|
#include "tribufu++/model/HashViewModel.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
HashViewModel::HashViewModel()
|
|
||||||
{
|
{
|
||||||
m_Value = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_ValueIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
HashViewModel::~HashViewModel()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void HashViewModel::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value HashViewModel::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_ValueIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("value"))] = ModelBase::toJson(m_Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HashViewModel::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("value"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("value")));
|
|
||||||
if(!fieldValue.is_null())
|
HashViewModel::HashViewModel()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setValue;
|
m_Value = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setValue);
|
m_ValueIsSet = false;
|
||||||
setValue(refVal_setValue);
|
}
|
||||||
|
|
||||||
|
HashViewModel::~HashViewModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashViewModel::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value HashViewModel::toJson() const
|
||||||
|
{
|
||||||
|
web::json::value val = web::json::value::object();
|
||||||
|
if (m_ValueIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("value"))] = ModelBase::toJson(m_Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HashViewModel::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("value"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("value")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setValue;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setValue);
|
||||||
|
setValue(refVal_setValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashViewModel::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_ValueIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("value")), m_Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HashViewModel::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("value"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setValue;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("value"))),
|
||||||
|
refVal_setValue);
|
||||||
|
setValue(refVal_setValue);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t HashViewModel::getValue() const
|
||||||
|
{
|
||||||
|
return m_Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashViewModel::setValue(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Value = value;
|
||||||
|
m_ValueIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HashViewModel::valueIsSet() const
|
||||||
|
{
|
||||||
|
return m_ValueIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashViewModel::unsetValue()
|
||||||
|
{
|
||||||
|
m_ValueIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HashViewModel::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_ValueIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("value")), m_Value));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HashViewModel::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("value"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setValue;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("value"))), refVal_setValue );
|
|
||||||
setValue(refVal_setValue);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t HashViewModel::getValue() const
|
|
||||||
{
|
|
||||||
return m_Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void HashViewModel::setValue(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Value = value;
|
|
||||||
m_ValueIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HashViewModel::valueIsSet() const
|
|
||||||
{
|
|
||||||
return m_ValueIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HashViewModel::unsetValue()
|
|
||||||
{
|
|
||||||
m_ValueIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,160 +10,162 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/IntrospectRequest.h"
|
#include "tribufu++/model/IntrospectRequest.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
IntrospectRequest::IntrospectRequest()
|
|
||||||
{
|
{
|
||||||
m_Token = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_TokenIsSet = false;
|
|
||||||
m_Token_type_hintIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IntrospectRequest::~IntrospectRequest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void IntrospectRequest::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value IntrospectRequest::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_TokenIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("token"))] = ModelBase::toJson(m_Token);
|
|
||||||
}
|
|
||||||
if(m_Token_type_hintIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("token_type_hint"))] = ModelBase::toJson(m_Token_type_hint);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IntrospectRequest::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("token"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("token")));
|
|
||||||
if(!fieldValue.is_null())
|
IntrospectRequest::IntrospectRequest()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setToken;
|
m_Token = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setToken);
|
m_TokenIsSet = false;
|
||||||
setToken(refVal_setToken);
|
m_Token_type_hintIsSet = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("token_type_hint"))))
|
IntrospectRequest::~IntrospectRequest()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("token_type_hint")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setTokenTypeHint);
|
|
||||||
setTokenTypeHint(refVal_setTokenTypeHint);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void IntrospectRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
void IntrospectRequest::validate()
|
||||||
{
|
{
|
||||||
utility::string_t namePrefix = prefix;
|
// TODO: implement validation
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
}
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
web::json::value IntrospectRequest::toJson() const
|
||||||
}
|
{
|
||||||
if(m_TokenIsSet)
|
web::json::value val = web::json::value::object();
|
||||||
{
|
if (m_TokenIsSet)
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("token")), m_Token));
|
{
|
||||||
}
|
|
||||||
if(m_Token_type_hintIsSet)
|
val[utility::conversions::to_string_t(U("token"))] = ModelBase::toJson(m_Token);
|
||||||
{
|
}
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("token_type_hint")), m_Token_type_hint));
|
if (m_Token_type_hintIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("token_type_hint"))] = ModelBase::toJson(m_Token_type_hint);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IntrospectRequest::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("token"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("token")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setToken;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setToken);
|
||||||
|
setToken(refVal_setToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("token_type_hint"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("token_type_hint")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setTokenTypeHint);
|
||||||
|
setTokenTypeHint(refVal_setTokenTypeHint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntrospectRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_TokenIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("token")), m_Token));
|
||||||
|
}
|
||||||
|
if (m_Token_type_hintIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("token_type_hint")), m_Token_type_hint));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IntrospectRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("token"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setToken;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("token"))),
|
||||||
|
refVal_setToken);
|
||||||
|
setToken(refVal_setToken);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("token_type_hint"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("token_type_hint"))),
|
||||||
|
refVal_setTokenTypeHint);
|
||||||
|
setTokenTypeHint(refVal_setTokenTypeHint);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t IntrospectRequest::getToken() const
|
||||||
|
{
|
||||||
|
return m_Token;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntrospectRequest::setToken(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Token = value;
|
||||||
|
m_TokenIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IntrospectRequest::tokenIsSet() const
|
||||||
|
{
|
||||||
|
return m_TokenIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntrospectRequest::unsetToken()
|
||||||
|
{
|
||||||
|
m_TokenIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<TokenHintType> IntrospectRequest::getTokenTypeHint() const
|
||||||
|
{
|
||||||
|
return m_Token_type_hint;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntrospectRequest::setTokenTypeHint(const std::shared_ptr<TokenHintType> &value)
|
||||||
|
{
|
||||||
|
m_Token_type_hint = value;
|
||||||
|
m_Token_type_hintIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IntrospectRequest::tokenTypeHintIsSet() const
|
||||||
|
{
|
||||||
|
return m_Token_type_hintIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntrospectRequest::unsetToken_type_hint()
|
||||||
|
{
|
||||||
|
m_Token_type_hintIsSet = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IntrospectRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("token"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setToken;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("token"))), refVal_setToken );
|
|
||||||
setToken(refVal_setToken);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("token_type_hint"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("token_type_hint"))), refVal_setTokenTypeHint );
|
|
||||||
setTokenTypeHint(refVal_setTokenTypeHint);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t IntrospectRequest::getToken() const
|
|
||||||
{
|
|
||||||
return m_Token;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void IntrospectRequest::setToken(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Token = value;
|
|
||||||
m_TokenIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IntrospectRequest::tokenIsSet() const
|
|
||||||
{
|
|
||||||
return m_TokenIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void IntrospectRequest::unsetToken()
|
|
||||||
{
|
|
||||||
m_TokenIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<TokenHintType> IntrospectRequest::getTokenTypeHint() const
|
|
||||||
{
|
|
||||||
return m_Token_type_hint;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void IntrospectRequest::setTokenTypeHint(const std::shared_ptr<TokenHintType>& value)
|
|
||||||
{
|
|
||||||
m_Token_type_hint = value;
|
|
||||||
m_Token_type_hintIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IntrospectRequest::tokenTypeHintIsSet() const
|
|
||||||
{
|
|
||||||
return m_Token_type_hintIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void IntrospectRequest::unsetToken_type_hint()
|
|
||||||
{
|
|
||||||
m_Token_type_hintIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -10,354 +10,358 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/LeaderboardItem.h"
|
#include "tribufu++/model/LeaderboardItem.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
LeaderboardItem::LeaderboardItem()
|
|
||||||
{
|
{
|
||||||
m_Name = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_NameIsSet = false;
|
|
||||||
m_Display_name = utility::conversions::to_string_t("");
|
|
||||||
m_Display_nameIsSet = false;
|
|
||||||
m_Photo_url = utility::conversions::to_string_t("");
|
|
||||||
m_Photo_urlIsSet = false;
|
|
||||||
m_Level = 0;
|
|
||||||
m_LevelIsSet = false;
|
|
||||||
m_Experience = 0.0;
|
|
||||||
m_ExperienceIsSet = false;
|
|
||||||
m_Points = 0.0;
|
|
||||||
m_PointsIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LeaderboardItem::~LeaderboardItem()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value LeaderboardItem::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
|
||||||
}
|
|
||||||
if(m_Display_nameIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("display_name"))] = ModelBase::toJson(m_Display_name);
|
|
||||||
}
|
|
||||||
if(m_Photo_urlIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("photo_url"))] = ModelBase::toJson(m_Photo_url);
|
|
||||||
}
|
|
||||||
if(m_LevelIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("level"))] = ModelBase::toJson(m_Level);
|
|
||||||
}
|
|
||||||
if(m_ExperienceIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("experience"))] = ModelBase::toJson(m_Experience);
|
|
||||||
}
|
|
||||||
if(m_PointsIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("points"))] = ModelBase::toJson(m_Points);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardItem::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
|
||||||
if(!fieldValue.is_null())
|
LeaderboardItem::LeaderboardItem()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setName;
|
m_Name = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
m_NameIsSet = false;
|
||||||
setName(refVal_setName);
|
m_Display_name = utility::conversions::to_string_t("");
|
||||||
|
m_Display_nameIsSet = false;
|
||||||
|
m_Photo_url = utility::conversions::to_string_t("");
|
||||||
|
m_Photo_urlIsSet = false;
|
||||||
|
m_Level = 0;
|
||||||
|
m_LevelIsSet = false;
|
||||||
|
m_Experience = 0.0;
|
||||||
|
m_ExperienceIsSet = false;
|
||||||
|
m_Points = 0.0;
|
||||||
|
m_PointsIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("display_name"))))
|
LeaderboardItem::~LeaderboardItem()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("display_name")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setDisplayName;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setDisplayName);
|
|
||||||
setDisplayName(refVal_setDisplayName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("photo_url"))))
|
void LeaderboardItem::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("photo_url")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setPhotoUrl;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrl);
|
|
||||||
setPhotoUrl(refVal_setPhotoUrl);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("level"))))
|
web::json::value LeaderboardItem::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("level")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
int32_t refVal_setLevel;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLevel);
|
if (m_NameIsSet)
|
||||||
setLevel(refVal_setLevel);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||||
|
}
|
||||||
|
if (m_Display_nameIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("display_name"))] = ModelBase::toJson(m_Display_name);
|
||||||
|
}
|
||||||
|
if (m_Photo_urlIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("photo_url"))] = ModelBase::toJson(m_Photo_url);
|
||||||
|
}
|
||||||
|
if (m_LevelIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("level"))] = ModelBase::toJson(m_Level);
|
||||||
|
}
|
||||||
|
if (m_ExperienceIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("experience"))] = ModelBase::toJson(m_Experience);
|
||||||
|
}
|
||||||
|
if (m_PointsIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("points"))] = ModelBase::toJson(m_Points);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("experience"))))
|
bool LeaderboardItem::fromJson(const web::json::value &val)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("experience")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
double refVal_setExperience;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setExperience);
|
if (val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||||
setExperience(refVal_setExperience);
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("display_name"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("display_name")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDisplayName;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setDisplayName);
|
||||||
|
setDisplayName(refVal_setDisplayName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("photo_url"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("photo_url")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPhotoUrl;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrl);
|
||||||
|
setPhotoUrl(refVal_setPhotoUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("level"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("level")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
int32_t refVal_setLevel;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setLevel);
|
||||||
|
setLevel(refVal_setLevel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("experience"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("experience")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
double refVal_setExperience;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setExperience);
|
||||||
|
setExperience(refVal_setExperience);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("points"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("points")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
double refVal_setPoints;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPoints);
|
||||||
|
setPoints(refVal_setPoints);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("points"))))
|
void LeaderboardItem::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
{
|
const utility::string_t &prefix) const
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("points")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
double refVal_setPoints;
|
utility::string_t namePrefix = prefix;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPoints);
|
if (namePrefix.size() > 0 &&
|
||||||
setPoints(refVal_setPoints);
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||||
|
}
|
||||||
|
if (m_Display_nameIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("display_name")), m_Display_name));
|
||||||
|
}
|
||||||
|
if (m_Photo_urlIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photo_url")),
|
||||||
|
m_Photo_url));
|
||||||
|
}
|
||||||
|
if (m_LevelIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("level")), m_Level));
|
||||||
|
}
|
||||||
|
if (m_ExperienceIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("experience")),
|
||||||
|
m_Experience));
|
||||||
|
}
|
||||||
|
if (m_PointsIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("points")), m_Points));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardItem::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))),
|
||||||
|
refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("display_name"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDisplayName;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("display_name"))), refVal_setDisplayName);
|
||||||
|
setDisplayName(refVal_setDisplayName);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("photo_url"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPhotoUrl;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("photo_url"))), refVal_setPhotoUrl);
|
||||||
|
setPhotoUrl(refVal_setPhotoUrl);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("level"))))
|
||||||
|
{
|
||||||
|
int32_t refVal_setLevel;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("level"))),
|
||||||
|
refVal_setLevel);
|
||||||
|
setLevel(refVal_setLevel);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("experience"))))
|
||||||
|
{
|
||||||
|
double refVal_setExperience;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("experience"))), refVal_setExperience);
|
||||||
|
setExperience(refVal_setExperience);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("points"))))
|
||||||
|
{
|
||||||
|
double refVal_setPoints;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("points"))),
|
||||||
|
refVal_setPoints);
|
||||||
|
setPoints(refVal_setPoints);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t LeaderboardItem::getName() const
|
||||||
|
{
|
||||||
|
return m_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::setName(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Name = value;
|
||||||
|
m_NameIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardItem::nameIsSet() const
|
||||||
|
{
|
||||||
|
return m_NameIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::unsetName()
|
||||||
|
{
|
||||||
|
m_NameIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t LeaderboardItem::getDisplayName() const
|
||||||
|
{
|
||||||
|
return m_Display_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::setDisplayName(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Display_name = value;
|
||||||
|
m_Display_nameIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardItem::displayNameIsSet() const
|
||||||
|
{
|
||||||
|
return m_Display_nameIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::unsetDisplay_name()
|
||||||
|
{
|
||||||
|
m_Display_nameIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t LeaderboardItem::getPhotoUrl() const
|
||||||
|
{
|
||||||
|
return m_Photo_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::setPhotoUrl(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Photo_url = value;
|
||||||
|
m_Photo_urlIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardItem::photoUrlIsSet() const
|
||||||
|
{
|
||||||
|
return m_Photo_urlIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::unsetPhoto_url()
|
||||||
|
{
|
||||||
|
m_Photo_urlIsSet = false;
|
||||||
|
}
|
||||||
|
int32_t LeaderboardItem::getLevel() const
|
||||||
|
{
|
||||||
|
return m_Level;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::setLevel(int32_t value)
|
||||||
|
{
|
||||||
|
m_Level = value;
|
||||||
|
m_LevelIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardItem::levelIsSet() const
|
||||||
|
{
|
||||||
|
return m_LevelIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::unsetLevel()
|
||||||
|
{
|
||||||
|
m_LevelIsSet = false;
|
||||||
|
}
|
||||||
|
double LeaderboardItem::getExperience() const
|
||||||
|
{
|
||||||
|
return m_Experience;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::setExperience(double value)
|
||||||
|
{
|
||||||
|
m_Experience = value;
|
||||||
|
m_ExperienceIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardItem::experienceIsSet() const
|
||||||
|
{
|
||||||
|
return m_ExperienceIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::unsetExperience()
|
||||||
|
{
|
||||||
|
m_ExperienceIsSet = false;
|
||||||
|
}
|
||||||
|
double LeaderboardItem::getPoints() const
|
||||||
|
{
|
||||||
|
return m_Points;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::setPoints(double value)
|
||||||
|
{
|
||||||
|
m_Points = value;
|
||||||
|
m_PointsIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardItem::pointsIsSet() const
|
||||||
|
{
|
||||||
|
return m_PointsIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardItem::unsetPoints()
|
||||||
|
{
|
||||||
|
m_PointsIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
|
||||||
}
|
|
||||||
if(m_Display_nameIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("display_name")), m_Display_name));
|
|
||||||
}
|
|
||||||
if(m_Photo_urlIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photo_url")), m_Photo_url));
|
|
||||||
}
|
|
||||||
if(m_LevelIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("level")), m_Level));
|
|
||||||
}
|
|
||||||
if(m_ExperienceIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("experience")), m_Experience));
|
|
||||||
}
|
|
||||||
if(m_PointsIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("points")), m_Points));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LeaderboardItem::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
|
||||||
setName(refVal_setName);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("display_name"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setDisplayName;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("display_name"))), refVal_setDisplayName );
|
|
||||||
setDisplayName(refVal_setDisplayName);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("photo_url"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setPhotoUrl;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photo_url"))), refVal_setPhotoUrl );
|
|
||||||
setPhotoUrl(refVal_setPhotoUrl);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("level"))))
|
|
||||||
{
|
|
||||||
int32_t refVal_setLevel;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("level"))), refVal_setLevel );
|
|
||||||
setLevel(refVal_setLevel);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("experience"))))
|
|
||||||
{
|
|
||||||
double refVal_setExperience;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("experience"))), refVal_setExperience );
|
|
||||||
setExperience(refVal_setExperience);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("points"))))
|
|
||||||
{
|
|
||||||
double refVal_setPoints;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("points"))), refVal_setPoints );
|
|
||||||
setPoints(refVal_setPoints);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t LeaderboardItem::getName() const
|
|
||||||
{
|
|
||||||
return m_Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LeaderboardItem::setName(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Name = value;
|
|
||||||
m_NameIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardItem::nameIsSet() const
|
|
||||||
{
|
|
||||||
return m_NameIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::unsetName()
|
|
||||||
{
|
|
||||||
m_NameIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t LeaderboardItem::getDisplayName() const
|
|
||||||
{
|
|
||||||
return m_Display_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LeaderboardItem::setDisplayName(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Display_name = value;
|
|
||||||
m_Display_nameIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardItem::displayNameIsSet() const
|
|
||||||
{
|
|
||||||
return m_Display_nameIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::unsetDisplay_name()
|
|
||||||
{
|
|
||||||
m_Display_nameIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t LeaderboardItem::getPhotoUrl() const
|
|
||||||
{
|
|
||||||
return m_Photo_url;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LeaderboardItem::setPhotoUrl(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Photo_url = value;
|
|
||||||
m_Photo_urlIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardItem::photoUrlIsSet() const
|
|
||||||
{
|
|
||||||
return m_Photo_urlIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::unsetPhoto_url()
|
|
||||||
{
|
|
||||||
m_Photo_urlIsSet = false;
|
|
||||||
}
|
|
||||||
int32_t LeaderboardItem::getLevel() const
|
|
||||||
{
|
|
||||||
return m_Level;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::setLevel(int32_t value)
|
|
||||||
{
|
|
||||||
m_Level = value;
|
|
||||||
m_LevelIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardItem::levelIsSet() const
|
|
||||||
{
|
|
||||||
return m_LevelIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::unsetLevel()
|
|
||||||
{
|
|
||||||
m_LevelIsSet = false;
|
|
||||||
}
|
|
||||||
double LeaderboardItem::getExperience() const
|
|
||||||
{
|
|
||||||
return m_Experience;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::setExperience(double value)
|
|
||||||
{
|
|
||||||
m_Experience = value;
|
|
||||||
m_ExperienceIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardItem::experienceIsSet() const
|
|
||||||
{
|
|
||||||
return m_ExperienceIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::unsetExperience()
|
|
||||||
{
|
|
||||||
m_ExperienceIsSet = false;
|
|
||||||
}
|
|
||||||
double LeaderboardItem::getPoints() const
|
|
||||||
{
|
|
||||||
return m_Points;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::setPoints(double value)
|
|
||||||
{
|
|
||||||
m_Points = value;
|
|
||||||
m_PointsIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardItem::pointsIsSet() const
|
|
||||||
{
|
|
||||||
return m_PointsIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardItem::unsetPoints()
|
|
||||||
{
|
|
||||||
m_PointsIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,109 +10,109 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/LeaderboardOrder.h"
|
#include "tribufu++/model/LeaderboardOrder.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
LeaderboardOrder::eLeaderboardOrder toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("level")))
|
|
||||||
return LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_LEVEL;
|
|
||||||
if (val == utility::conversions::to_string_t(U("points")))
|
|
||||||
return LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_POINTS;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(LeaderboardOrder::eLeaderboardOrder e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_LEVEL:
|
|
||||||
return U("level");
|
|
||||||
case LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_POINTS:
|
|
||||||
return U("points");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LeaderboardOrder::LeaderboardOrder()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
LeaderboardOrder::~LeaderboardOrder()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardOrder::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value LeaderboardOrder::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardOrder::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardOrder::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LeaderboardOrder::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
LeaderboardOrder::eLeaderboardOrder toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("level")))
|
||||||
|
return LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_LEVEL;
|
||||||
|
if (val == utility::conversions::to_string_t(U("points")))
|
||||||
|
return LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_POINTS;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(LeaderboardOrder::eLeaderboardOrder e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_LEVEL:
|
||||||
|
return U("level");
|
||||||
|
case LeaderboardOrder::eLeaderboardOrder::LeaderboardOrder_POINTS:
|
||||||
|
return U("points");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LeaderboardOrder::LeaderboardOrder()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
LeaderboardOrder::~LeaderboardOrder()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardOrder::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value LeaderboardOrder::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardOrder::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardOrder::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LeaderboardOrder::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
LeaderboardOrder::eLeaderboardOrder LeaderboardOrder::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeaderboardOrder::setValue(LeaderboardOrder::eLeaderboardOrder const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LeaderboardOrder::eLeaderboardOrder LeaderboardOrder::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LeaderboardOrder::setValue(LeaderboardOrder::eLeaderboardOrder const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,129 +10,128 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/LoginProvider.h"
|
#include "tribufu++/model/LoginProvider.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
LoginProvider::eLoginProvider toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("steam")))
|
|
||||||
return LoginProvider::eLoginProvider::LoginProvider_STEAM;
|
|
||||||
if (val == utility::conversions::to_string_t(U("epic")))
|
|
||||||
return LoginProvider::eLoginProvider::LoginProvider_EPIC;
|
|
||||||
if (val == utility::conversions::to_string_t(U("discord")))
|
|
||||||
return LoginProvider::eLoginProvider::LoginProvider_DISCORD;
|
|
||||||
if (val == utility::conversions::to_string_t(U("microsoft")))
|
|
||||||
return LoginProvider::eLoginProvider::LoginProvider_MICROSOFT;
|
|
||||||
if (val == utility::conversions::to_string_t(U("playstation")))
|
|
||||||
return LoginProvider::eLoginProvider::LoginProvider_PLAYSTATION;
|
|
||||||
if (val == utility::conversions::to_string_t(U("google")))
|
|
||||||
return LoginProvider::eLoginProvider::LoginProvider_GOOGLE;
|
|
||||||
if (val == utility::conversions::to_string_t(U("apple")))
|
|
||||||
return LoginProvider::eLoginProvider::LoginProvider_APPLE;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(LoginProvider::eLoginProvider e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case LoginProvider::eLoginProvider::LoginProvider_STEAM:
|
|
||||||
return U("steam");
|
|
||||||
case LoginProvider::eLoginProvider::LoginProvider_EPIC:
|
|
||||||
return U("epic");
|
|
||||||
case LoginProvider::eLoginProvider::LoginProvider_DISCORD:
|
|
||||||
return U("discord");
|
|
||||||
case LoginProvider::eLoginProvider::LoginProvider_MICROSOFT:
|
|
||||||
return U("microsoft");
|
|
||||||
case LoginProvider::eLoginProvider::LoginProvider_PLAYSTATION:
|
|
||||||
return U("playstation");
|
|
||||||
case LoginProvider::eLoginProvider::LoginProvider_GOOGLE:
|
|
||||||
return U("google");
|
|
||||||
case LoginProvider::eLoginProvider::LoginProvider_APPLE:
|
|
||||||
return U("apple");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LoginProvider::LoginProvider()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
LoginProvider::~LoginProvider()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginProvider::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value LoginProvider::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginProvider::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginProvider::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginProvider::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
LoginProvider::eLoginProvider toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("steam")))
|
||||||
|
return LoginProvider::eLoginProvider::LoginProvider_STEAM;
|
||||||
|
if (val == utility::conversions::to_string_t(U("epic")))
|
||||||
|
return LoginProvider::eLoginProvider::LoginProvider_EPIC;
|
||||||
|
if (val == utility::conversions::to_string_t(U("discord")))
|
||||||
|
return LoginProvider::eLoginProvider::LoginProvider_DISCORD;
|
||||||
|
if (val == utility::conversions::to_string_t(U("microsoft")))
|
||||||
|
return LoginProvider::eLoginProvider::LoginProvider_MICROSOFT;
|
||||||
|
if (val == utility::conversions::to_string_t(U("playstation")))
|
||||||
|
return LoginProvider::eLoginProvider::LoginProvider_PLAYSTATION;
|
||||||
|
if (val == utility::conversions::to_string_t(U("google")))
|
||||||
|
return LoginProvider::eLoginProvider::LoginProvider_GOOGLE;
|
||||||
|
if (val == utility::conversions::to_string_t(U("apple")))
|
||||||
|
return LoginProvider::eLoginProvider::LoginProvider_APPLE;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(LoginProvider::eLoginProvider e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case LoginProvider::eLoginProvider::LoginProvider_STEAM:
|
||||||
|
return U("steam");
|
||||||
|
case LoginProvider::eLoginProvider::LoginProvider_EPIC:
|
||||||
|
return U("epic");
|
||||||
|
case LoginProvider::eLoginProvider::LoginProvider_DISCORD:
|
||||||
|
return U("discord");
|
||||||
|
case LoginProvider::eLoginProvider::LoginProvider_MICROSOFT:
|
||||||
|
return U("microsoft");
|
||||||
|
case LoginProvider::eLoginProvider::LoginProvider_PLAYSTATION:
|
||||||
|
return U("playstation");
|
||||||
|
case LoginProvider::eLoginProvider::LoginProvider_GOOGLE:
|
||||||
|
return U("google");
|
||||||
|
case LoginProvider::eLoginProvider::LoginProvider_APPLE:
|
||||||
|
return U("apple");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoginProvider::LoginProvider()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginProvider::~LoginProvider()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginProvider::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value LoginProvider::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginProvider::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginProvider::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginProvider::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginProvider::eLoginProvider LoginProvider::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginProvider::setValue(LoginProvider::eLoginProvider const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginProvider::eLoginProvider LoginProvider::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginProvider::setValue(LoginProvider::eLoginProvider const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,161 +10,161 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/LoginRequest.h"
|
#include "tribufu++/model/LoginRequest.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
LoginRequest::LoginRequest()
|
|
||||||
{
|
{
|
||||||
m_Login = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_LoginIsSet = false;
|
|
||||||
m_Password = utility::conversions::to_string_t("");
|
|
||||||
m_PasswordIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LoginRequest::~LoginRequest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginRequest::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value LoginRequest::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_LoginIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("login"))] = ModelBase::toJson(m_Login);
|
|
||||||
}
|
|
||||||
if(m_PasswordIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginRequest::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("login"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("login")));
|
|
||||||
if(!fieldValue.is_null())
|
LoginRequest::LoginRequest()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setLogin;
|
m_Login = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLogin);
|
m_LoginIsSet = false;
|
||||||
setLogin(refVal_setLogin);
|
m_Password = utility::conversions::to_string_t("");
|
||||||
|
m_PasswordIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("password"))))
|
LoginRequest::~LoginRequest()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("password")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setPassword;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
|
|
||||||
setPassword(refVal_setPassword);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
void LoginRequest::validate()
|
||||||
{
|
{
|
||||||
utility::string_t namePrefix = prefix;
|
// TODO: implement validation
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
}
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
web::json::value LoginRequest::toJson() const
|
||||||
}
|
{
|
||||||
if(m_LoginIsSet)
|
web::json::value val = web::json::value::object();
|
||||||
{
|
if (m_LoginIsSet)
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("login")), m_Login));
|
{
|
||||||
}
|
|
||||||
if(m_PasswordIsSet)
|
val[utility::conversions::to_string_t(U("login"))] = ModelBase::toJson(m_Login);
|
||||||
{
|
}
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")), m_Password));
|
if (m_PasswordIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginRequest::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("login"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("login")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setLogin;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setLogin);
|
||||||
|
setLogin(refVal_setLogin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("password"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("password")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPassword;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
|
||||||
|
setPassword(refVal_setPassword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_LoginIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("login")), m_Login));
|
||||||
|
}
|
||||||
|
if (m_PasswordIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")),
|
||||||
|
m_Password));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("login"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setLogin;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("login"))),
|
||||||
|
refVal_setLogin);
|
||||||
|
setLogin(refVal_setLogin);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("password"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPassword;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword);
|
||||||
|
setPassword(refVal_setPassword);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t LoginRequest::getLogin() const
|
||||||
|
{
|
||||||
|
return m_Login;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginRequest::setLogin(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Login = value;
|
||||||
|
m_LoginIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginRequest::loginIsSet() const
|
||||||
|
{
|
||||||
|
return m_LoginIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginRequest::unsetLogin()
|
||||||
|
{
|
||||||
|
m_LoginIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t LoginRequest::getPassword() const
|
||||||
|
{
|
||||||
|
return m_Password;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginRequest::setPassword(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Password = value;
|
||||||
|
m_PasswordIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginRequest::passwordIsSet() const
|
||||||
|
{
|
||||||
|
return m_PasswordIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginRequest::unsetPassword()
|
||||||
|
{
|
||||||
|
m_PasswordIsSet = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LoginRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("login"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setLogin;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("login"))), refVal_setLogin );
|
|
||||||
setLogin(refVal_setLogin);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("password"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setPassword;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword );
|
|
||||||
setPassword(refVal_setPassword);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t LoginRequest::getLogin() const
|
|
||||||
{
|
|
||||||
return m_Login;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LoginRequest::setLogin(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Login = value;
|
|
||||||
m_LoginIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginRequest::loginIsSet() const
|
|
||||||
{
|
|
||||||
return m_LoginIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginRequest::unsetLogin()
|
|
||||||
{
|
|
||||||
m_LoginIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t LoginRequest::getPassword() const
|
|
||||||
{
|
|
||||||
return m_Password;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LoginRequest::setPassword(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Password = value;
|
|
||||||
m_PasswordIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginRequest::passwordIsSet() const
|
|
||||||
{
|
|
||||||
return m_PasswordIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginRequest::unsetPassword()
|
|
||||||
{
|
|
||||||
m_PasswordIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,257 +10,259 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/LoginResponse.h"
|
#include "tribufu++/model/LoginResponse.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
LoginResponse::LoginResponse()
|
|
||||||
{
|
{
|
||||||
m_UserIsSet = false;
|
namespace models
|
||||||
m_Access_token = utility::conversions::to_string_t("");
|
|
||||||
m_Access_tokenIsSet = false;
|
|
||||||
m_Refresh_token = utility::conversions::to_string_t("");
|
|
||||||
m_Refresh_tokenIsSet = false;
|
|
||||||
m_Expires_in = 0L;
|
|
||||||
m_Expires_inIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LoginResponse::~LoginResponse()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginResponse::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value LoginResponse::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_UserIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("user"))] = ModelBase::toJson(m_User);
|
|
||||||
}
|
|
||||||
if(m_Access_tokenIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("access_token"))] = ModelBase::toJson(m_Access_token);
|
|
||||||
}
|
|
||||||
if(m_Refresh_tokenIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("refresh_token"))] = ModelBase::toJson(m_Refresh_token);
|
|
||||||
}
|
|
||||||
if(m_Expires_inIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("expires_in"))] = ModelBase::toJson(m_Expires_in);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginResponse::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("user"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("user")));
|
|
||||||
if(!fieldValue.is_null())
|
LoginResponse::LoginResponse()
|
||||||
{
|
{
|
||||||
std::shared_ptr<UserInfo> refVal_setUser;
|
m_UserIsSet = false;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUser);
|
m_Access_token = utility::conversions::to_string_t("");
|
||||||
setUser(refVal_setUser);
|
m_Access_tokenIsSet = false;
|
||||||
|
m_Refresh_token = utility::conversions::to_string_t("");
|
||||||
|
m_Refresh_tokenIsSet = false;
|
||||||
|
m_Expires_in = 0L;
|
||||||
|
m_Expires_inIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("access_token"))))
|
LoginResponse::~LoginResponse()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("access_token")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setAccessToken;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setAccessToken);
|
|
||||||
setAccessToken(refVal_setAccessToken);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("refresh_token"))))
|
void LoginResponse::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("refresh_token")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setRefreshToken;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRefreshToken);
|
|
||||||
setRefreshToken(refVal_setRefreshToken);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("expires_in"))))
|
web::json::value LoginResponse::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("expires_in")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
int64_t refVal_setExpiresIn;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setExpiresIn);
|
if (m_UserIsSet)
|
||||||
setExpiresIn(refVal_setExpiresIn);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("user"))] = ModelBase::toJson(m_User);
|
||||||
|
}
|
||||||
|
if (m_Access_tokenIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("access_token"))] = ModelBase::toJson(m_Access_token);
|
||||||
|
}
|
||||||
|
if (m_Refresh_tokenIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("refresh_token"))] = ModelBase::toJson(m_Refresh_token);
|
||||||
|
}
|
||||||
|
if (m_Expires_inIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("expires_in"))] = ModelBase::toJson(m_Expires_in);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginResponse::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("user"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("user")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<UserInfo> refVal_setUser;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setUser);
|
||||||
|
setUser(refVal_setUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("access_token"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("access_token")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setAccessToken;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setAccessToken);
|
||||||
|
setAccessToken(refVal_setAccessToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("refresh_token"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("refresh_token")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setRefreshToken;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setRefreshToken);
|
||||||
|
setRefreshToken(refVal_setRefreshToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("expires_in"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("expires_in")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
int64_t refVal_setExpiresIn;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setExpiresIn);
|
||||||
|
setExpiresIn(refVal_setExpiresIn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_UserIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("user")), m_User));
|
||||||
|
}
|
||||||
|
if (m_Access_tokenIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("access_token")), m_Access_token));
|
||||||
|
}
|
||||||
|
if (m_Refresh_tokenIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("refresh_token")), m_Refresh_token));
|
||||||
|
}
|
||||||
|
if (m_Expires_inIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("expires_in")),
|
||||||
|
m_Expires_in));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginResponse::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("user"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<UserInfo> refVal_setUser;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("user"))),
|
||||||
|
refVal_setUser);
|
||||||
|
setUser(refVal_setUser);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("access_token"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setAccessToken;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("access_token"))), refVal_setAccessToken);
|
||||||
|
setAccessToken(refVal_setAccessToken);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("refresh_token"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setRefreshToken;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("refresh_token"))),
|
||||||
|
refVal_setRefreshToken);
|
||||||
|
setRefreshToken(refVal_setRefreshToken);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("expires_in"))))
|
||||||
|
{
|
||||||
|
int64_t refVal_setExpiresIn;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("expires_in"))), refVal_setExpiresIn);
|
||||||
|
setExpiresIn(refVal_setExpiresIn);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<UserInfo> LoginResponse::getUser() const
|
||||||
|
{
|
||||||
|
return m_User;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::setUser(const std::shared_ptr<UserInfo> &value)
|
||||||
|
{
|
||||||
|
m_User = value;
|
||||||
|
m_UserIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginResponse::userIsSet() const
|
||||||
|
{
|
||||||
|
return m_UserIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::unsetUser()
|
||||||
|
{
|
||||||
|
m_UserIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t LoginResponse::getAccessToken() const
|
||||||
|
{
|
||||||
|
return m_Access_token;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::setAccessToken(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Access_token = value;
|
||||||
|
m_Access_tokenIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginResponse::accessTokenIsSet() const
|
||||||
|
{
|
||||||
|
return m_Access_tokenIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::unsetAccess_token()
|
||||||
|
{
|
||||||
|
m_Access_tokenIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t LoginResponse::getRefreshToken() const
|
||||||
|
{
|
||||||
|
return m_Refresh_token;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::setRefreshToken(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Refresh_token = value;
|
||||||
|
m_Refresh_tokenIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginResponse::refreshTokenIsSet() const
|
||||||
|
{
|
||||||
|
return m_Refresh_tokenIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::unsetRefresh_token()
|
||||||
|
{
|
||||||
|
m_Refresh_tokenIsSet = false;
|
||||||
|
}
|
||||||
|
int64_t LoginResponse::getExpiresIn() const
|
||||||
|
{
|
||||||
|
return m_Expires_in;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::setExpiresIn(int64_t value)
|
||||||
|
{
|
||||||
|
m_Expires_in = value;
|
||||||
|
m_Expires_inIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoginResponse::expiresInIsSet() const
|
||||||
|
{
|
||||||
|
return m_Expires_inIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LoginResponse::unsetExpires_in()
|
||||||
|
{
|
||||||
|
m_Expires_inIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginResponse::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_UserIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("user")), m_User));
|
|
||||||
}
|
|
||||||
if(m_Access_tokenIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("access_token")), m_Access_token));
|
|
||||||
}
|
|
||||||
if(m_Refresh_tokenIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("refresh_token")), m_Refresh_token));
|
|
||||||
}
|
|
||||||
if(m_Expires_inIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("expires_in")), m_Expires_in));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LoginResponse::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("user"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<UserInfo> refVal_setUser;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("user"))), refVal_setUser );
|
|
||||||
setUser(refVal_setUser);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("access_token"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setAccessToken;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("access_token"))), refVal_setAccessToken );
|
|
||||||
setAccessToken(refVal_setAccessToken);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("refresh_token"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setRefreshToken;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("refresh_token"))), refVal_setRefreshToken );
|
|
||||||
setRefreshToken(refVal_setRefreshToken);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("expires_in"))))
|
|
||||||
{
|
|
||||||
int64_t refVal_setExpiresIn;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("expires_in"))), refVal_setExpiresIn );
|
|
||||||
setExpiresIn(refVal_setExpiresIn);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<UserInfo> LoginResponse::getUser() const
|
|
||||||
{
|
|
||||||
return m_User;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LoginResponse::setUser(const std::shared_ptr<UserInfo>& value)
|
|
||||||
{
|
|
||||||
m_User = value;
|
|
||||||
m_UserIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginResponse::userIsSet() const
|
|
||||||
{
|
|
||||||
return m_UserIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginResponse::unsetUser()
|
|
||||||
{
|
|
||||||
m_UserIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t LoginResponse::getAccessToken() const
|
|
||||||
{
|
|
||||||
return m_Access_token;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LoginResponse::setAccessToken(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Access_token = value;
|
|
||||||
m_Access_tokenIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginResponse::accessTokenIsSet() const
|
|
||||||
{
|
|
||||||
return m_Access_tokenIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginResponse::unsetAccess_token()
|
|
||||||
{
|
|
||||||
m_Access_tokenIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t LoginResponse::getRefreshToken() const
|
|
||||||
{
|
|
||||||
return m_Refresh_token;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LoginResponse::setRefreshToken(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Refresh_token = value;
|
|
||||||
m_Refresh_tokenIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginResponse::refreshTokenIsSet() const
|
|
||||||
{
|
|
||||||
return m_Refresh_tokenIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginResponse::unsetRefresh_token()
|
|
||||||
{
|
|
||||||
m_Refresh_tokenIsSet = false;
|
|
||||||
}
|
|
||||||
int64_t LoginResponse::getExpiresIn() const
|
|
||||||
{
|
|
||||||
return m_Expires_in;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginResponse::setExpiresIn(int64_t value)
|
|
||||||
{
|
|
||||||
m_Expires_in = value;
|
|
||||||
m_Expires_inIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoginResponse::expiresInIsSet() const
|
|
||||||
{
|
|
||||||
return m_Expires_inIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoginResponse::unsetExpires_in()
|
|
||||||
{
|
|
||||||
m_Expires_inIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -10,112 +10,114 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/RefreshRequest.h"
|
#include "tribufu++/model/RefreshRequest.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
RefreshRequest::RefreshRequest()
|
|
||||||
{
|
{
|
||||||
m_Refresh_token = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_Refresh_tokenIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
RefreshRequest::~RefreshRequest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void RefreshRequest::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value RefreshRequest::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_Refresh_tokenIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("refresh_token"))] = ModelBase::toJson(m_Refresh_token);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RefreshRequest::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("refresh_token"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("refresh_token")));
|
|
||||||
if(!fieldValue.is_null())
|
RefreshRequest::RefreshRequest()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setRefreshToken;
|
m_Refresh_token = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRefreshToken);
|
m_Refresh_tokenIsSet = false;
|
||||||
setRefreshToken(refVal_setRefreshToken);
|
}
|
||||||
|
|
||||||
|
RefreshRequest::~RefreshRequest()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RefreshRequest::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value RefreshRequest::toJson() const
|
||||||
|
{
|
||||||
|
web::json::value val = web::json::value::object();
|
||||||
|
if (m_Refresh_tokenIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("refresh_token"))] = ModelBase::toJson(m_Refresh_token);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RefreshRequest::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("refresh_token"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("refresh_token")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setRefreshToken;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setRefreshToken);
|
||||||
|
setRefreshToken(refVal_setRefreshToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RefreshRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_Refresh_tokenIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("refresh_token")), m_Refresh_token));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RefreshRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("refresh_token"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setRefreshToken;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("refresh_token"))),
|
||||||
|
refVal_setRefreshToken);
|
||||||
|
setRefreshToken(refVal_setRefreshToken);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t RefreshRequest::getRefreshToken() const
|
||||||
|
{
|
||||||
|
return m_Refresh_token;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RefreshRequest::setRefreshToken(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Refresh_token = value;
|
||||||
|
m_Refresh_tokenIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RefreshRequest::refreshTokenIsSet() const
|
||||||
|
{
|
||||||
|
return m_Refresh_tokenIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RefreshRequest::unsetRefresh_token()
|
||||||
|
{
|
||||||
|
m_Refresh_tokenIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RefreshRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_Refresh_tokenIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("refresh_token")), m_Refresh_token));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RefreshRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("refresh_token"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setRefreshToken;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("refresh_token"))), refVal_setRefreshToken );
|
|
||||||
setRefreshToken(refVal_setRefreshToken);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t RefreshRequest::getRefreshToken() const
|
|
||||||
{
|
|
||||||
return m_Refresh_token;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RefreshRequest::setRefreshToken(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Refresh_token = value;
|
|
||||||
m_Refresh_tokenIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RefreshRequest::refreshTokenIsSet() const
|
|
||||||
{
|
|
||||||
return m_Refresh_tokenIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RefreshRequest::unsetRefresh_token()
|
|
||||||
{
|
|
||||||
m_Refresh_tokenIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,259 +10,260 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/RegisterRequest.h"
|
#include "tribufu++/model/RegisterRequest.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
RegisterRequest::RegisterRequest()
|
|
||||||
{
|
{
|
||||||
m_Uuid = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_UuidIsSet = false;
|
|
||||||
m_Name = utility::conversions::to_string_t("");
|
|
||||||
m_NameIsSet = false;
|
|
||||||
m_Email = utility::conversions::to_string_t("");
|
|
||||||
m_EmailIsSet = false;
|
|
||||||
m_Password = utility::conversions::to_string_t("");
|
|
||||||
m_PasswordIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
RegisterRequest::~RegisterRequest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegisterRequest::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value RegisterRequest::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_UuidIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("uuid"))] = ModelBase::toJson(m_Uuid);
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
|
||||||
}
|
|
||||||
if(m_EmailIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("email"))] = ModelBase::toJson(m_Email);
|
|
||||||
}
|
|
||||||
if(m_PasswordIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RegisterRequest::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("uuid"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("uuid")));
|
|
||||||
if(!fieldValue.is_null())
|
RegisterRequest::RegisterRequest()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setUuid;
|
m_Uuid = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUuid);
|
m_UuidIsSet = false;
|
||||||
setUuid(refVal_setUuid);
|
m_Name = utility::conversions::to_string_t("");
|
||||||
|
m_NameIsSet = false;
|
||||||
|
m_Email = utility::conversions::to_string_t("");
|
||||||
|
m_EmailIsSet = false;
|
||||||
|
m_Password = utility::conversions::to_string_t("");
|
||||||
|
m_PasswordIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
RegisterRequest::~RegisterRequest()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
|
||||||
setName(refVal_setName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("email"))))
|
void RegisterRequest::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("email")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setEmail;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setEmail);
|
|
||||||
setEmail(refVal_setEmail);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("password"))))
|
web::json::value RegisterRequest::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("password")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setPassword;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
|
if (m_UuidIsSet)
|
||||||
setPassword(refVal_setPassword);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("uuid"))] = ModelBase::toJson(m_Uuid);
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||||
|
}
|
||||||
|
if (m_EmailIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("email"))] = ModelBase::toJson(m_Email);
|
||||||
|
}
|
||||||
|
if (m_PasswordIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("password"))] = ModelBase::toJson(m_Password);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegisterRequest::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("uuid"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("uuid")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setUuid;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setUuid);
|
||||||
|
setUuid(refVal_setUuid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("email"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("email")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setEmail;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setEmail);
|
||||||
|
setEmail(refVal_setEmail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("password"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("password")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPassword;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
|
||||||
|
setPassword(refVal_setPassword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_UuidIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("uuid")), m_Uuid));
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||||
|
}
|
||||||
|
if (m_EmailIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("email")), m_Email));
|
||||||
|
}
|
||||||
|
if (m_PasswordIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")),
|
||||||
|
m_Password));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegisterRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("uuid"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setUuid;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("uuid"))),
|
||||||
|
refVal_setUuid);
|
||||||
|
setUuid(refVal_setUuid);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))),
|
||||||
|
refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("email"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setEmail;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))),
|
||||||
|
refVal_setEmail);
|
||||||
|
setEmail(refVal_setEmail);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("password"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setPassword;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword);
|
||||||
|
setPassword(refVal_setPassword);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t RegisterRequest::getUuid() const
|
||||||
|
{
|
||||||
|
return m_Uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::setUuid(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Uuid = value;
|
||||||
|
m_UuidIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegisterRequest::uuidIsSet() const
|
||||||
|
{
|
||||||
|
return m_UuidIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::unsetUuid()
|
||||||
|
{
|
||||||
|
m_UuidIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t RegisterRequest::getName() const
|
||||||
|
{
|
||||||
|
return m_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::setName(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Name = value;
|
||||||
|
m_NameIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegisterRequest::nameIsSet() const
|
||||||
|
{
|
||||||
|
return m_NameIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::unsetName()
|
||||||
|
{
|
||||||
|
m_NameIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t RegisterRequest::getEmail() const
|
||||||
|
{
|
||||||
|
return m_Email;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::setEmail(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Email = value;
|
||||||
|
m_EmailIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegisterRequest::emailIsSet() const
|
||||||
|
{
|
||||||
|
return m_EmailIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::unsetEmail()
|
||||||
|
{
|
||||||
|
m_EmailIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t RegisterRequest::getPassword() const
|
||||||
|
{
|
||||||
|
return m_Password;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::setPassword(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Password = value;
|
||||||
|
m_PasswordIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegisterRequest::passwordIsSet() const
|
||||||
|
{
|
||||||
|
return m_PasswordIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegisterRequest::unsetPassword()
|
||||||
|
{
|
||||||
|
m_PasswordIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegisterRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_UuidIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("uuid")), m_Uuid));
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
|
||||||
}
|
|
||||||
if(m_EmailIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("email")), m_Email));
|
|
||||||
}
|
|
||||||
if(m_PasswordIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("password")), m_Password));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RegisterRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("uuid"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setUuid;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("uuid"))), refVal_setUuid );
|
|
||||||
setUuid(refVal_setUuid);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
|
||||||
setName(refVal_setName);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("email"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setEmail;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_setEmail );
|
|
||||||
setEmail(refVal_setEmail);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("password"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setPassword;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword );
|
|
||||||
setPassword(refVal_setPassword);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t RegisterRequest::getUuid() const
|
|
||||||
{
|
|
||||||
return m_Uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RegisterRequest::setUuid(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Uuid = value;
|
|
||||||
m_UuidIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RegisterRequest::uuidIsSet() const
|
|
||||||
{
|
|
||||||
return m_UuidIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegisterRequest::unsetUuid()
|
|
||||||
{
|
|
||||||
m_UuidIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t RegisterRequest::getName() const
|
|
||||||
{
|
|
||||||
return m_Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RegisterRequest::setName(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Name = value;
|
|
||||||
m_NameIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RegisterRequest::nameIsSet() const
|
|
||||||
{
|
|
||||||
return m_NameIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegisterRequest::unsetName()
|
|
||||||
{
|
|
||||||
m_NameIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t RegisterRequest::getEmail() const
|
|
||||||
{
|
|
||||||
return m_Email;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RegisterRequest::setEmail(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Email = value;
|
|
||||||
m_EmailIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RegisterRequest::emailIsSet() const
|
|
||||||
{
|
|
||||||
return m_EmailIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegisterRequest::unsetEmail()
|
|
||||||
{
|
|
||||||
m_EmailIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t RegisterRequest::getPassword() const
|
|
||||||
{
|
|
||||||
return m_Password;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RegisterRequest::setPassword(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Password = value;
|
|
||||||
m_PasswordIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RegisterRequest::passwordIsSet() const
|
|
||||||
{
|
|
||||||
return m_PasswordIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegisterRequest::unsetPassword()
|
|
||||||
{
|
|
||||||
m_PasswordIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,109 +10,108 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/ResponseType.h"
|
#include "tribufu++/model/ResponseType.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
ResponseType::eResponseType toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("code")))
|
|
||||||
return ResponseType::eResponseType::ResponseType_CODE;
|
|
||||||
if (val == utility::conversions::to_string_t(U("token")))
|
|
||||||
return ResponseType::eResponseType::ResponseType_TOKEN;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(ResponseType::eResponseType e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case ResponseType::eResponseType::ResponseType_CODE:
|
|
||||||
return U("code");
|
|
||||||
case ResponseType::eResponseType::ResponseType_TOKEN:
|
|
||||||
return U("token");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ResponseType::ResponseType()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ResponseType::~ResponseType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResponseType::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value ResponseType::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ResponseType::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResponseType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ResponseType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
ResponseType::eResponseType toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("code")))
|
||||||
|
return ResponseType::eResponseType::ResponseType_CODE;
|
||||||
|
if (val == utility::conversions::to_string_t(U("token")))
|
||||||
|
return ResponseType::eResponseType::ResponseType_TOKEN;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(ResponseType::eResponseType e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case ResponseType::eResponseType::ResponseType_CODE:
|
||||||
|
return U("code");
|
||||||
|
case ResponseType::eResponseType::ResponseType_TOKEN:
|
||||||
|
return U("token");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResponseType::ResponseType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponseType::~ResponseType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResponseType::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value ResponseType::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ResponseType::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResponseType::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ResponseType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
ResponseType::eResponseType ResponseType::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResponseType::setValue(ResponseType::eResponseType const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ResponseType::eResponseType ResponseType::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResponseType::setValue(ResponseType::eResponseType const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,160 +10,161 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/RevokeRequest.h"
|
#include "tribufu++/model/RevokeRequest.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
RevokeRequest::RevokeRequest()
|
|
||||||
{
|
{
|
||||||
m_Token = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_TokenIsSet = false;
|
|
||||||
m_Token_type_hintIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
RevokeRequest::~RevokeRequest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void RevokeRequest::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value RevokeRequest::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_TokenIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("token"))] = ModelBase::toJson(m_Token);
|
|
||||||
}
|
|
||||||
if(m_Token_type_hintIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("token_type_hint"))] = ModelBase::toJson(m_Token_type_hint);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RevokeRequest::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("token"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("token")));
|
|
||||||
if(!fieldValue.is_null())
|
RevokeRequest::RevokeRequest()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setToken;
|
m_Token = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setToken);
|
m_TokenIsSet = false;
|
||||||
setToken(refVal_setToken);
|
m_Token_type_hintIsSet = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("token_type_hint"))))
|
RevokeRequest::~RevokeRequest()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("token_type_hint")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setTokenTypeHint);
|
|
||||||
setTokenTypeHint(refVal_setTokenTypeHint);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RevokeRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
void RevokeRequest::validate()
|
||||||
{
|
{
|
||||||
utility::string_t namePrefix = prefix;
|
// TODO: implement validation
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
}
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
web::json::value RevokeRequest::toJson() const
|
||||||
}
|
{
|
||||||
if(m_TokenIsSet)
|
web::json::value val = web::json::value::object();
|
||||||
{
|
if (m_TokenIsSet)
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("token")), m_Token));
|
{
|
||||||
}
|
|
||||||
if(m_Token_type_hintIsSet)
|
val[utility::conversions::to_string_t(U("token"))] = ModelBase::toJson(m_Token);
|
||||||
{
|
}
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("token_type_hint")), m_Token_type_hint));
|
if (m_Token_type_hintIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("token_type_hint"))] = ModelBase::toJson(m_Token_type_hint);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RevokeRequest::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("token"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("token")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setToken;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setToken);
|
||||||
|
setToken(refVal_setToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("token_type_hint"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("token_type_hint")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setTokenTypeHint);
|
||||||
|
setTokenTypeHint(refVal_setTokenTypeHint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RevokeRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_TokenIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("token")), m_Token));
|
||||||
|
}
|
||||||
|
if (m_Token_type_hintIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("token_type_hint")), m_Token_type_hint));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RevokeRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("token"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setToken;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("token"))),
|
||||||
|
refVal_setToken);
|
||||||
|
setToken(refVal_setToken);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("token_type_hint"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("token_type_hint"))),
|
||||||
|
refVal_setTokenTypeHint);
|
||||||
|
setTokenTypeHint(refVal_setTokenTypeHint);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t RevokeRequest::getToken() const
|
||||||
|
{
|
||||||
|
return m_Token;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RevokeRequest::setToken(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Token = value;
|
||||||
|
m_TokenIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RevokeRequest::tokenIsSet() const
|
||||||
|
{
|
||||||
|
return m_TokenIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RevokeRequest::unsetToken()
|
||||||
|
{
|
||||||
|
m_TokenIsSet = false;
|
||||||
|
}
|
||||||
|
std::shared_ptr<TokenHintType> RevokeRequest::getTokenTypeHint() const
|
||||||
|
{
|
||||||
|
return m_Token_type_hint;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RevokeRequest::setTokenTypeHint(const std::shared_ptr<TokenHintType> &value)
|
||||||
|
{
|
||||||
|
m_Token_type_hint = value;
|
||||||
|
m_Token_type_hintIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RevokeRequest::tokenTypeHintIsSet() const
|
||||||
|
{
|
||||||
|
return m_Token_type_hintIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RevokeRequest::unsetToken_type_hint()
|
||||||
|
{
|
||||||
|
m_Token_type_hintIsSet = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RevokeRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("token"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setToken;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("token"))), refVal_setToken );
|
|
||||||
setToken(refVal_setToken);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("token_type_hint"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<TokenHintType> refVal_setTokenTypeHint;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("token_type_hint"))), refVal_setTokenTypeHint );
|
|
||||||
setTokenTypeHint(refVal_setTokenTypeHint);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t RevokeRequest::getToken() const
|
|
||||||
{
|
|
||||||
return m_Token;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RevokeRequest::setToken(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Token = value;
|
|
||||||
m_TokenIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RevokeRequest::tokenIsSet() const
|
|
||||||
{
|
|
||||||
return m_TokenIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RevokeRequest::unsetToken()
|
|
||||||
{
|
|
||||||
m_TokenIsSet = false;
|
|
||||||
}
|
|
||||||
std::shared_ptr<TokenHintType> RevokeRequest::getTokenTypeHint() const
|
|
||||||
{
|
|
||||||
return m_Token_type_hint;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RevokeRequest::setTokenTypeHint(const std::shared_ptr<TokenHintType>& value)
|
|
||||||
{
|
|
||||||
m_Token_type_hint = value;
|
|
||||||
m_Token_type_hintIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RevokeRequest::tokenTypeHintIsSet() const
|
|
||||||
{
|
|
||||||
return m_Token_type_hintIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RevokeRequest::unsetToken_type_hint()
|
|
||||||
{
|
|
||||||
m_Token_type_hintIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,257 +10,258 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/SearchRequest.h"
|
#include "tribufu++/model/SearchRequest.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
SearchRequest::SearchRequest()
|
|
||||||
{
|
{
|
||||||
m_TypeIsSet = false;
|
namespace models
|
||||||
m_Query = utility::conversions::to_string_t("");
|
|
||||||
m_QueryIsSet = false;
|
|
||||||
m_Page = 0;
|
|
||||||
m_PageIsSet = false;
|
|
||||||
m_Game_id = utility::conversions::to_string_t("");
|
|
||||||
m_Game_idIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
SearchRequest::~SearchRequest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchRequest::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value SearchRequest::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_TypeIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type);
|
|
||||||
}
|
|
||||||
if(m_QueryIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("query"))] = ModelBase::toJson(m_Query);
|
|
||||||
}
|
|
||||||
if(m_PageIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("page"))] = ModelBase::toJson(m_Page);
|
|
||||||
}
|
|
||||||
if(m_Game_idIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("game_id"))] = ModelBase::toJson(m_Game_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchRequest::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("type"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type")));
|
|
||||||
if(!fieldValue.is_null())
|
SearchRequest::SearchRequest()
|
||||||
{
|
{
|
||||||
std::shared_ptr<SearchType> refVal_setType;
|
m_TypeIsSet = false;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setType);
|
m_Query = utility::conversions::to_string_t("");
|
||||||
setType(refVal_setType);
|
m_QueryIsSet = false;
|
||||||
|
m_Page = 0;
|
||||||
|
m_PageIsSet = false;
|
||||||
|
m_Game_id = utility::conversions::to_string_t("");
|
||||||
|
m_Game_idIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("query"))))
|
SearchRequest::~SearchRequest()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("query")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setQuery;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setQuery);
|
|
||||||
setQuery(refVal_setQuery);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("page"))))
|
void SearchRequest::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("page")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
int32_t refVal_setPage;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPage);
|
|
||||||
setPage(refVal_setPage);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("game_id"))))
|
web::json::value SearchRequest::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("game_id")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setGameId;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setGameId);
|
if (m_TypeIsSet)
|
||||||
setGameId(refVal_setGameId);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type);
|
||||||
|
}
|
||||||
|
if (m_QueryIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("query"))] = ModelBase::toJson(m_Query);
|
||||||
|
}
|
||||||
|
if (m_PageIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("page"))] = ModelBase::toJson(m_Page);
|
||||||
|
}
|
||||||
|
if (m_Game_idIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("game_id"))] = ModelBase::toJson(m_Game_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchRequest::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("type"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("type")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::shared_ptr<SearchType> refVal_setType;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setType);
|
||||||
|
setType(refVal_setType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("query"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("query")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setQuery;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setQuery);
|
||||||
|
setQuery(refVal_setQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("page"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("page")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
int32_t refVal_setPage;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPage);
|
||||||
|
setPage(refVal_setPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("game_id"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("game_id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setGameId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setGameId);
|
||||||
|
setGameId(refVal_setGameId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_TypeIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type));
|
||||||
|
}
|
||||||
|
if (m_QueryIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("query")), m_Query));
|
||||||
|
}
|
||||||
|
if (m_PageIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page")), m_Page));
|
||||||
|
}
|
||||||
|
if (m_Game_idIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("game_id")), m_Game_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("type"))))
|
||||||
|
{
|
||||||
|
std::shared_ptr<SearchType> refVal_setType;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))),
|
||||||
|
refVal_setType);
|
||||||
|
setType(refVal_setType);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("query"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setQuery;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("query"))),
|
||||||
|
refVal_setQuery);
|
||||||
|
setQuery(refVal_setQuery);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("page"))))
|
||||||
|
{
|
||||||
|
int32_t refVal_setPage;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page"))),
|
||||||
|
refVal_setPage);
|
||||||
|
setPage(refVal_setPage);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("game_id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setGameId;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("game_id"))),
|
||||||
|
refVal_setGameId);
|
||||||
|
setGameId(refVal_setGameId);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<SearchType> SearchRequest::getType() const
|
||||||
|
{
|
||||||
|
return m_Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::setType(const std::shared_ptr<SearchType> &value)
|
||||||
|
{
|
||||||
|
m_Type = value;
|
||||||
|
m_TypeIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchRequest::typeIsSet() const
|
||||||
|
{
|
||||||
|
return m_TypeIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::unsetType()
|
||||||
|
{
|
||||||
|
m_TypeIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t SearchRequest::getQuery() const
|
||||||
|
{
|
||||||
|
return m_Query;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::setQuery(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Query = value;
|
||||||
|
m_QueryIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchRequest::queryIsSet() const
|
||||||
|
{
|
||||||
|
return m_QueryIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::unsetQuery()
|
||||||
|
{
|
||||||
|
m_QueryIsSet = false;
|
||||||
|
}
|
||||||
|
int32_t SearchRequest::getPage() const
|
||||||
|
{
|
||||||
|
return m_Page;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::setPage(int32_t value)
|
||||||
|
{
|
||||||
|
m_Page = value;
|
||||||
|
m_PageIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchRequest::pageIsSet() const
|
||||||
|
{
|
||||||
|
return m_PageIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::unsetPage()
|
||||||
|
{
|
||||||
|
m_PageIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t SearchRequest::getGameId() const
|
||||||
|
{
|
||||||
|
return m_Game_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::setGameId(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Game_id = value;
|
||||||
|
m_Game_idIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchRequest::gameIdIsSet() const
|
||||||
|
{
|
||||||
|
return m_Game_idIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchRequest::unsetGame_id()
|
||||||
|
{
|
||||||
|
m_Game_idIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_TypeIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type));
|
|
||||||
}
|
|
||||||
if(m_QueryIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("query")), m_Query));
|
|
||||||
}
|
|
||||||
if(m_PageIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("page")), m_Page));
|
|
||||||
}
|
|
||||||
if(m_Game_idIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("game_id")), m_Game_id));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SearchRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("type"))))
|
|
||||||
{
|
|
||||||
std::shared_ptr<SearchType> refVal_setType;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType );
|
|
||||||
setType(refVal_setType);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("query"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setQuery;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("query"))), refVal_setQuery );
|
|
||||||
setQuery(refVal_setQuery);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("page"))))
|
|
||||||
{
|
|
||||||
int32_t refVal_setPage;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("page"))), refVal_setPage );
|
|
||||||
setPage(refVal_setPage);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("game_id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setGameId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("game_id"))), refVal_setGameId );
|
|
||||||
setGameId(refVal_setGameId);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<SearchType> SearchRequest::getType() const
|
|
||||||
{
|
|
||||||
return m_Type;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SearchRequest::setType(const std::shared_ptr<SearchType>& value)
|
|
||||||
{
|
|
||||||
m_Type = value;
|
|
||||||
m_TypeIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchRequest::typeIsSet() const
|
|
||||||
{
|
|
||||||
return m_TypeIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchRequest::unsetType()
|
|
||||||
{
|
|
||||||
m_TypeIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t SearchRequest::getQuery() const
|
|
||||||
{
|
|
||||||
return m_Query;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SearchRequest::setQuery(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Query = value;
|
|
||||||
m_QueryIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchRequest::queryIsSet() const
|
|
||||||
{
|
|
||||||
return m_QueryIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchRequest::unsetQuery()
|
|
||||||
{
|
|
||||||
m_QueryIsSet = false;
|
|
||||||
}
|
|
||||||
int32_t SearchRequest::getPage() const
|
|
||||||
{
|
|
||||||
return m_Page;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchRequest::setPage(int32_t value)
|
|
||||||
{
|
|
||||||
m_Page = value;
|
|
||||||
m_PageIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchRequest::pageIsSet() const
|
|
||||||
{
|
|
||||||
return m_PageIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchRequest::unsetPage()
|
|
||||||
{
|
|
||||||
m_PageIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t SearchRequest::getGameId() const
|
|
||||||
{
|
|
||||||
return m_Game_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SearchRequest::setGameId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Game_id = value;
|
|
||||||
m_Game_idIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchRequest::gameIdIsSet() const
|
|
||||||
{
|
|
||||||
return m_Game_idIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchRequest::unsetGame_id()
|
|
||||||
{
|
|
||||||
m_Game_idIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,117 +10,116 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/SearchType.h"
|
#include "tribufu++/model/SearchType.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
SearchType::eSearchType toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("user")))
|
|
||||||
return SearchType::eSearchType::SearchType_USER;
|
|
||||||
if (val == utility::conversions::to_string_t(U("group")))
|
|
||||||
return SearchType::eSearchType::SearchType_GROUP;
|
|
||||||
if (val == utility::conversions::to_string_t(U("server")))
|
|
||||||
return SearchType::eSearchType::SearchType_SERVER;
|
|
||||||
if (val == utility::conversions::to_string_t(U("cluster")))
|
|
||||||
return SearchType::eSearchType::SearchType_CLUSTER;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(SearchType::eSearchType e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case SearchType::eSearchType::SearchType_USER:
|
|
||||||
return U("user");
|
|
||||||
case SearchType::eSearchType::SearchType_GROUP:
|
|
||||||
return U("group");
|
|
||||||
case SearchType::eSearchType::SearchType_SERVER:
|
|
||||||
return U("server");
|
|
||||||
case SearchType::eSearchType::SearchType_CLUSTER:
|
|
||||||
return U("cluster");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SearchType::SearchType()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
SearchType::~SearchType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchType::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value SearchType::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchType::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
SearchType::eSearchType toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("user")))
|
||||||
|
return SearchType::eSearchType::SearchType_USER;
|
||||||
|
if (val == utility::conversions::to_string_t(U("group")))
|
||||||
|
return SearchType::eSearchType::SearchType_GROUP;
|
||||||
|
if (val == utility::conversions::to_string_t(U("server")))
|
||||||
|
return SearchType::eSearchType::SearchType_SERVER;
|
||||||
|
if (val == utility::conversions::to_string_t(U("cluster")))
|
||||||
|
return SearchType::eSearchType::SearchType_CLUSTER;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(SearchType::eSearchType e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case SearchType::eSearchType::SearchType_USER:
|
||||||
|
return U("user");
|
||||||
|
case SearchType::eSearchType::SearchType_GROUP:
|
||||||
|
return U("group");
|
||||||
|
case SearchType::eSearchType::SearchType_SERVER:
|
||||||
|
return U("server");
|
||||||
|
case SearchType::eSearchType::SearchType_CLUSTER:
|
||||||
|
return U("cluster");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SearchType::SearchType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchType::~SearchType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchType::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value SearchType::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchType::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchType::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchType::eSearchType SearchType::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchType::setValue(SearchType::eSearchType const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchType::eSearchType SearchType::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchType::setValue(SearchType::eSearchType const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,207 +10,212 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/ServerMetrics.h"
|
#include "tribufu++/model/ServerMetrics.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
ServerMetrics::ServerMetrics()
|
|
||||||
{
|
{
|
||||||
m_Server_count = 0;
|
namespace models
|
||||||
m_Server_countIsSet = false;
|
|
||||||
m_Package_count = 0;
|
|
||||||
m_Package_countIsSet = false;
|
|
||||||
m_Country_count = 0;
|
|
||||||
m_Country_countIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ServerMetrics::~ServerMetrics()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value ServerMetrics::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_Server_countIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("server_count"))] = ModelBase::toJson(m_Server_count);
|
|
||||||
}
|
|
||||||
if(m_Package_countIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("package_count"))] = ModelBase::toJson(m_Package_count);
|
|
||||||
}
|
|
||||||
if(m_Country_countIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("country_count"))] = ModelBase::toJson(m_Country_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerMetrics::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("server_count"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("server_count")));
|
|
||||||
if(!fieldValue.is_null())
|
ServerMetrics::ServerMetrics()
|
||||||
{
|
{
|
||||||
int32_t refVal_setServerCount;
|
m_Server_count = 0;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setServerCount);
|
m_Server_countIsSet = false;
|
||||||
setServerCount(refVal_setServerCount);
|
m_Package_count = 0;
|
||||||
|
m_Package_countIsSet = false;
|
||||||
|
m_Country_count = 0;
|
||||||
|
m_Country_countIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("package_count"))))
|
ServerMetrics::~ServerMetrics()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("package_count")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
int32_t refVal_setPackageCount;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPackageCount);
|
|
||||||
setPackageCount(refVal_setPackageCount);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("country_count"))))
|
void ServerMetrics::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("country_count")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
int32_t refVal_setCountryCount;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCountryCount);
|
}
|
||||||
setCountryCount(refVal_setCountryCount);
|
|
||||||
|
web::json::value ServerMetrics::toJson() const
|
||||||
|
{
|
||||||
|
web::json::value val = web::json::value::object();
|
||||||
|
if (m_Server_countIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("server_count"))] = ModelBase::toJson(m_Server_count);
|
||||||
|
}
|
||||||
|
if (m_Package_countIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("package_count"))] = ModelBase::toJson(m_Package_count);
|
||||||
|
}
|
||||||
|
if (m_Country_countIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("country_count"))] = ModelBase::toJson(m_Country_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ServerMetrics::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("server_count"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("server_count")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
int32_t refVal_setServerCount;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setServerCount);
|
||||||
|
setServerCount(refVal_setServerCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("package_count"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("package_count")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
int32_t refVal_setPackageCount;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPackageCount);
|
||||||
|
setPackageCount(refVal_setPackageCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("country_count"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("country_count")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
int32_t refVal_setCountryCount;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setCountryCount);
|
||||||
|
setCountryCount(refVal_setCountryCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerMetrics::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_Server_countIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("server_count")), m_Server_count));
|
||||||
|
}
|
||||||
|
if (m_Package_countIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("package_count")), m_Package_count));
|
||||||
|
}
|
||||||
|
if (m_Country_countIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("country_count")), m_Country_count));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ServerMetrics::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("server_count"))))
|
||||||
|
{
|
||||||
|
int32_t refVal_setServerCount;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("server_count"))), refVal_setServerCount);
|
||||||
|
setServerCount(refVal_setServerCount);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("package_count"))))
|
||||||
|
{
|
||||||
|
int32_t refVal_setPackageCount;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("package_count"))),
|
||||||
|
refVal_setPackageCount);
|
||||||
|
setPackageCount(refVal_setPackageCount);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("country_count"))))
|
||||||
|
{
|
||||||
|
int32_t refVal_setCountryCount;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("country_count"))),
|
||||||
|
refVal_setCountryCount);
|
||||||
|
setCountryCount(refVal_setCountryCount);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t ServerMetrics::getServerCount() const
|
||||||
|
{
|
||||||
|
return m_Server_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerMetrics::setServerCount(int32_t value)
|
||||||
|
{
|
||||||
|
m_Server_count = value;
|
||||||
|
m_Server_countIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ServerMetrics::serverCountIsSet() const
|
||||||
|
{
|
||||||
|
return m_Server_countIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerMetrics::unsetServer_count()
|
||||||
|
{
|
||||||
|
m_Server_countIsSet = false;
|
||||||
|
}
|
||||||
|
int32_t ServerMetrics::getPackageCount() const
|
||||||
|
{
|
||||||
|
return m_Package_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerMetrics::setPackageCount(int32_t value)
|
||||||
|
{
|
||||||
|
m_Package_count = value;
|
||||||
|
m_Package_countIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ServerMetrics::packageCountIsSet() const
|
||||||
|
{
|
||||||
|
return m_Package_countIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerMetrics::unsetPackage_count()
|
||||||
|
{
|
||||||
|
m_Package_countIsSet = false;
|
||||||
|
}
|
||||||
|
int32_t ServerMetrics::getCountryCount() const
|
||||||
|
{
|
||||||
|
return m_Country_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerMetrics::setCountryCount(int32_t value)
|
||||||
|
{
|
||||||
|
m_Country_count = value;
|
||||||
|
m_Country_countIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ServerMetrics::countryCountIsSet() const
|
||||||
|
{
|
||||||
|
return m_Country_countIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerMetrics::unsetCountry_count()
|
||||||
|
{
|
||||||
|
m_Country_countIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_Server_countIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("server_count")), m_Server_count));
|
|
||||||
}
|
|
||||||
if(m_Package_countIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("package_count")), m_Package_count));
|
|
||||||
}
|
|
||||||
if(m_Country_countIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("country_count")), m_Country_count));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServerMetrics::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("server_count"))))
|
|
||||||
{
|
|
||||||
int32_t refVal_setServerCount;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("server_count"))), refVal_setServerCount );
|
|
||||||
setServerCount(refVal_setServerCount);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("package_count"))))
|
|
||||||
{
|
|
||||||
int32_t refVal_setPackageCount;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("package_count"))), refVal_setPackageCount );
|
|
||||||
setPackageCount(refVal_setPackageCount);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("country_count"))))
|
|
||||||
{
|
|
||||||
int32_t refVal_setCountryCount;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("country_count"))), refVal_setCountryCount );
|
|
||||||
setCountryCount(refVal_setCountryCount);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int32_t ServerMetrics::getServerCount() const
|
|
||||||
{
|
|
||||||
return m_Server_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::setServerCount(int32_t value)
|
|
||||||
{
|
|
||||||
m_Server_count = value;
|
|
||||||
m_Server_countIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerMetrics::serverCountIsSet() const
|
|
||||||
{
|
|
||||||
return m_Server_countIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::unsetServer_count()
|
|
||||||
{
|
|
||||||
m_Server_countIsSet = false;
|
|
||||||
}
|
|
||||||
int32_t ServerMetrics::getPackageCount() const
|
|
||||||
{
|
|
||||||
return m_Package_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::setPackageCount(int32_t value)
|
|
||||||
{
|
|
||||||
m_Package_count = value;
|
|
||||||
m_Package_countIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerMetrics::packageCountIsSet() const
|
|
||||||
{
|
|
||||||
return m_Package_countIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::unsetPackage_count()
|
|
||||||
{
|
|
||||||
m_Package_countIsSet = false;
|
|
||||||
}
|
|
||||||
int32_t ServerMetrics::getCountryCount() const
|
|
||||||
{
|
|
||||||
return m_Country_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::setCountryCount(int32_t value)
|
|
||||||
{
|
|
||||||
m_Country_count = value;
|
|
||||||
m_Country_countIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerMetrics::countryCountIsSet() const
|
|
||||||
{
|
|
||||||
return m_Country_countIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerMetrics::unsetCountry_count()
|
|
||||||
{
|
|
||||||
m_Country_countIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,113 +10,112 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/ServerStatus.h"
|
#include "tribufu++/model/ServerStatus.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
ServerStatus::eServerStatus toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("unknown")))
|
|
||||||
return ServerStatus::eServerStatus::ServerStatus_UNKNOWN;
|
|
||||||
if (val == utility::conversions::to_string_t(U("offline")))
|
|
||||||
return ServerStatus::eServerStatus::ServerStatus_OFFLINE;
|
|
||||||
if (val == utility::conversions::to_string_t(U("online")))
|
|
||||||
return ServerStatus::eServerStatus::ServerStatus_ONLINE;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(ServerStatus::eServerStatus e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case ServerStatus::eServerStatus::ServerStatus_UNKNOWN:
|
|
||||||
return U("unknown");
|
|
||||||
case ServerStatus::eServerStatus::ServerStatus_OFFLINE:
|
|
||||||
return U("offline");
|
|
||||||
case ServerStatus::eServerStatus::ServerStatus_ONLINE:
|
|
||||||
return U("online");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ServerStatus::ServerStatus()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ServerStatus::~ServerStatus()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerStatus::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value ServerStatus::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerStatus::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerStatus::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerStatus::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
ServerStatus::eServerStatus toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("unknown")))
|
||||||
|
return ServerStatus::eServerStatus::ServerStatus_UNKNOWN;
|
||||||
|
if (val == utility::conversions::to_string_t(U("offline")))
|
||||||
|
return ServerStatus::eServerStatus::ServerStatus_OFFLINE;
|
||||||
|
if (val == utility::conversions::to_string_t(U("online")))
|
||||||
|
return ServerStatus::eServerStatus::ServerStatus_ONLINE;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(ServerStatus::eServerStatus e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case ServerStatus::eServerStatus::ServerStatus_UNKNOWN:
|
||||||
|
return U("unknown");
|
||||||
|
case ServerStatus::eServerStatus::ServerStatus_OFFLINE:
|
||||||
|
return U("offline");
|
||||||
|
case ServerStatus::eServerStatus::ServerStatus_ONLINE:
|
||||||
|
return U("online");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ServerStatus::ServerStatus()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerStatus::~ServerStatus()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerStatus::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value ServerStatus::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ServerStatus::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerStatus::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ServerStatus::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerStatus::eServerStatus ServerStatus::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerStatus::setValue(ServerStatus::eServerStatus const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerStatus::eServerStatus ServerStatus::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerStatus::setValue(ServerStatus::eServerStatus const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,404 +10,404 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/Subscription.h"
|
#include "tribufu++/model/Subscription.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
Subscription::Subscription()
|
|
||||||
{
|
{
|
||||||
m_Id = utility::conversions::to_string_t("");
|
namespace models
|
||||||
m_IdIsSet = false;
|
|
||||||
m_Name = utility::conversions::to_string_t("");
|
|
||||||
m_NameIsSet = false;
|
|
||||||
m_Description = utility::conversions::to_string_t("");
|
|
||||||
m_DescriptionIsSet = false;
|
|
||||||
m_Image_url = utility::conversions::to_string_t("");
|
|
||||||
m_Image_urlIsSet = false;
|
|
||||||
m_PricesIsSet = false;
|
|
||||||
m_Created = utility::datetime();
|
|
||||||
m_CreatedIsSet = false;
|
|
||||||
m_Updated = utility::datetime();
|
|
||||||
m_UpdatedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Subscription::~Subscription()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value Subscription::toJson() const
|
|
||||||
{
|
|
||||||
web::json::value val = web::json::value::object();
|
|
||||||
if(m_IdIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
|
||||||
}
|
|
||||||
if(m_DescriptionIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("description"))] = ModelBase::toJson(m_Description);
|
|
||||||
}
|
|
||||||
if(m_Image_urlIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("image_url"))] = ModelBase::toJson(m_Image_url);
|
|
||||||
}
|
|
||||||
if(m_PricesIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("prices"))] = ModelBase::toJson(m_Prices);
|
|
||||||
}
|
|
||||||
if(m_CreatedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("created"))] = ModelBase::toJson(m_Created);
|
|
||||||
}
|
|
||||||
if(m_UpdatedIsSet)
|
|
||||||
{
|
|
||||||
|
|
||||||
val[utility::conversions::to_string_t(U("updated"))] = ModelBase::toJson(m_Updated);
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("id"))))
|
|
||||||
{
|
{
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
|
|
||||||
if(!fieldValue.is_null())
|
Subscription::Subscription()
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setId;
|
m_Id = utility::conversions::to_string_t("");
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
m_IdIsSet = false;
|
||||||
setId(refVal_setId);
|
m_Name = utility::conversions::to_string_t("");
|
||||||
|
m_NameIsSet = false;
|
||||||
|
m_Description = utility::conversions::to_string_t("");
|
||||||
|
m_DescriptionIsSet = false;
|
||||||
|
m_Image_url = utility::conversions::to_string_t("");
|
||||||
|
m_Image_urlIsSet = false;
|
||||||
|
m_PricesIsSet = false;
|
||||||
|
m_Created = utility::datetime();
|
||||||
|
m_CreatedIsSet = false;
|
||||||
|
m_Updated = utility::datetime();
|
||||||
|
m_UpdatedIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("name"))))
|
Subscription::~Subscription()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
|
||||||
setName(refVal_setName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("description"))))
|
void Subscription::validate()
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("description")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setDescription;
|
// TODO: implement validation
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setDescription);
|
|
||||||
setDescription(refVal_setDescription);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("image_url"))))
|
web::json::value Subscription::toJson() const
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("image_url")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::string_t refVal_setImageUrl;
|
web::json::value val = web::json::value::object();
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setImageUrl);
|
if (m_IdIsSet)
|
||||||
setImageUrl(refVal_setImageUrl);
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("id"))] = ModelBase::toJson(m_Id);
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("name"))] = ModelBase::toJson(m_Name);
|
||||||
|
}
|
||||||
|
if (m_DescriptionIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("description"))] = ModelBase::toJson(m_Description);
|
||||||
|
}
|
||||||
|
if (m_Image_urlIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("image_url"))] = ModelBase::toJson(m_Image_url);
|
||||||
|
}
|
||||||
|
if (m_PricesIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("prices"))] = ModelBase::toJson(m_Prices);
|
||||||
|
}
|
||||||
|
if (m_CreatedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("created"))] = ModelBase::toJson(m_Created);
|
||||||
|
}
|
||||||
|
if (m_UpdatedIsSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
val[utility::conversions::to_string_t(U("updated"))] = ModelBase::toJson(m_Updated);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("prices"))))
|
bool Subscription::fromJson(const web::json::value &val)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("prices")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
std::map<utility::string_t, double> refVal_setPrices;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPrices);
|
if (val.has_field(utility::conversions::to_string_t(U("id"))))
|
||||||
setPrices(refVal_setPrices);
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("id")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setId;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||||
|
setId(refVal_setId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("name")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("description"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("description")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDescription;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setDescription);
|
||||||
|
setDescription(refVal_setDescription);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("image_url"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("image_url")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setImageUrl;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setImageUrl);
|
||||||
|
setImageUrl(refVal_setImageUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("prices"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("prices")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
std::map<utility::string_t, double> refVal_setPrices;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setPrices);
|
||||||
|
setPrices(refVal_setPrices);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("created"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("created")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setCreated;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setCreated);
|
||||||
|
setCreated(refVal_setCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (val.has_field(utility::conversions::to_string_t(U("updated"))))
|
||||||
|
{
|
||||||
|
const web::json::value &fieldValue = val.at(utility::conversions::to_string_t(U("updated")));
|
||||||
|
if (!fieldValue.is_null())
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setUpdated;
|
||||||
|
ok &= ModelBase::fromJson(fieldValue, refVal_setUpdated);
|
||||||
|
setUpdated(refVal_setUpdated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("created"))))
|
void Subscription::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
{
|
const utility::string_t &prefix) const
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("created")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setCreated;
|
utility::string_t namePrefix = prefix;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCreated);
|
if (namePrefix.size() > 0 &&
|
||||||
setCreated(refVal_setCreated);
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
if (m_IdIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
||||||
|
}
|
||||||
|
if (m_NameIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
||||||
|
}
|
||||||
|
if (m_DescriptionIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(
|
||||||
|
namePrefix + utility::conversions::to_string_t(U("description")), m_Description));
|
||||||
|
}
|
||||||
|
if (m_Image_urlIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("image_url")),
|
||||||
|
m_Image_url));
|
||||||
|
}
|
||||||
|
if (m_PricesIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("prices")), m_Prices));
|
||||||
|
}
|
||||||
|
if (m_CreatedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("created")), m_Created));
|
||||||
|
}
|
||||||
|
if (m_UpdatedIsSet)
|
||||||
|
{
|
||||||
|
multipart->add(
|
||||||
|
ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("updated")), m_Updated));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(val.has_field(utility::conversions::to_string_t(U("updated"))))
|
bool Subscription::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
{
|
|
||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("updated")));
|
|
||||||
if(!fieldValue.is_null())
|
|
||||||
{
|
{
|
||||||
utility::datetime refVal_setUpdated;
|
bool ok = true;
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUpdated);
|
utility::string_t namePrefix = prefix;
|
||||||
setUpdated(refVal_setUpdated);
|
if (namePrefix.size() > 0 &&
|
||||||
|
namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
||||||
|
{
|
||||||
|
namePrefix += utility::conversions::to_string_t(U("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("id"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setId;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))),
|
||||||
|
refVal_setId);
|
||||||
|
setId(refVal_setId);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setName;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))),
|
||||||
|
refVal_setName);
|
||||||
|
setName(refVal_setName);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("description"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setDescription;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("description"))), refVal_setDescription);
|
||||||
|
setDescription(refVal_setDescription);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("image_url"))))
|
||||||
|
{
|
||||||
|
utility::string_t refVal_setImageUrl;
|
||||||
|
ok &= ModelBase::fromHttpContent(
|
||||||
|
multipart->getContent(utility::conversions::to_string_t(U("image_url"))), refVal_setImageUrl);
|
||||||
|
setImageUrl(refVal_setImageUrl);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("prices"))))
|
||||||
|
{
|
||||||
|
std::map<utility::string_t, double> refVal_setPrices;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("prices"))),
|
||||||
|
refVal_setPrices);
|
||||||
|
setPrices(refVal_setPrices);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("created"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setCreated;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("created"))),
|
||||||
|
refVal_setCreated);
|
||||||
|
setCreated(refVal_setCreated);
|
||||||
|
}
|
||||||
|
if (multipart->hasContent(utility::conversions::to_string_t(U("updated"))))
|
||||||
|
{
|
||||||
|
utility::datetime refVal_setUpdated;
|
||||||
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("updated"))),
|
||||||
|
refVal_setUpdated);
|
||||||
|
setUpdated(refVal_setUpdated);
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
utility::string_t Subscription::getId() const
|
||||||
|
{
|
||||||
|
return m_Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::setId(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Id = value;
|
||||||
|
m_IdIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subscription::idIsSet() const
|
||||||
|
{
|
||||||
|
return m_IdIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::unsetId()
|
||||||
|
{
|
||||||
|
m_IdIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t Subscription::getName() const
|
||||||
|
{
|
||||||
|
return m_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::setName(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Name = value;
|
||||||
|
m_NameIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subscription::nameIsSet() const
|
||||||
|
{
|
||||||
|
return m_NameIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::unsetName()
|
||||||
|
{
|
||||||
|
m_NameIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t Subscription::getDescription() const
|
||||||
|
{
|
||||||
|
return m_Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::setDescription(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Description = value;
|
||||||
|
m_DescriptionIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subscription::descriptionIsSet() const
|
||||||
|
{
|
||||||
|
return m_DescriptionIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::unsetDescription()
|
||||||
|
{
|
||||||
|
m_DescriptionIsSet = false;
|
||||||
|
}
|
||||||
|
utility::string_t Subscription::getImageUrl() const
|
||||||
|
{
|
||||||
|
return m_Image_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::setImageUrl(const utility::string_t &value)
|
||||||
|
{
|
||||||
|
m_Image_url = value;
|
||||||
|
m_Image_urlIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subscription::imageUrlIsSet() const
|
||||||
|
{
|
||||||
|
return m_Image_urlIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::unsetImage_url()
|
||||||
|
{
|
||||||
|
m_Image_urlIsSet = false;
|
||||||
|
}
|
||||||
|
std::map<utility::string_t, double> Subscription::getPrices() const
|
||||||
|
{
|
||||||
|
return m_Prices;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::setPrices(std::map<utility::string_t, double> value)
|
||||||
|
{
|
||||||
|
m_Prices = value;
|
||||||
|
m_PricesIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subscription::pricesIsSet() const
|
||||||
|
{
|
||||||
|
return m_PricesIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::unsetPrices()
|
||||||
|
{
|
||||||
|
m_PricesIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime Subscription::getCreated() const
|
||||||
|
{
|
||||||
|
return m_Created;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::setCreated(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Created = value;
|
||||||
|
m_CreatedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subscription::createdIsSet() const
|
||||||
|
{
|
||||||
|
return m_CreatedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::unsetCreated()
|
||||||
|
{
|
||||||
|
m_CreatedIsSet = false;
|
||||||
|
}
|
||||||
|
utility::datetime Subscription::getUpdated() const
|
||||||
|
{
|
||||||
|
return m_Updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::setUpdated(const utility::datetime &value)
|
||||||
|
{
|
||||||
|
m_Updated = value;
|
||||||
|
m_UpdatedIsSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subscription::updatedIsSet() const
|
||||||
|
{
|
||||||
|
return m_UpdatedIsSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Subscription::unsetUpdated()
|
||||||
|
{
|
||||||
|
m_UpdatedIsSet = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
if(m_IdIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("id")), m_Id));
|
|
||||||
}
|
|
||||||
if(m_NameIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("name")), m_Name));
|
|
||||||
}
|
|
||||||
if(m_DescriptionIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("description")), m_Description));
|
|
||||||
}
|
|
||||||
if(m_Image_urlIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("image_url")), m_Image_url));
|
|
||||||
}
|
|
||||||
if(m_PricesIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("prices")), m_Prices));
|
|
||||||
}
|
|
||||||
if(m_CreatedIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("created")), m_Created));
|
|
||||||
}
|
|
||||||
if(m_UpdatedIsSet)
|
|
||||||
{
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("updated")), m_Updated));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Subscription::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U(".")))
|
|
||||||
{
|
|
||||||
namePrefix += utility::conversions::to_string_t(U("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setId;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
|
|
||||||
setId(refVal_setId);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setName;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
|
|
||||||
setName(refVal_setName);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("description"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setDescription;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("description"))), refVal_setDescription );
|
|
||||||
setDescription(refVal_setDescription);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("image_url"))))
|
|
||||||
{
|
|
||||||
utility::string_t refVal_setImageUrl;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("image_url"))), refVal_setImageUrl );
|
|
||||||
setImageUrl(refVal_setImageUrl);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("prices"))))
|
|
||||||
{
|
|
||||||
std::map<utility::string_t, double> refVal_setPrices;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("prices"))), refVal_setPrices );
|
|
||||||
setPrices(refVal_setPrices);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("created"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setCreated;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("created"))), refVal_setCreated );
|
|
||||||
setCreated(refVal_setCreated);
|
|
||||||
}
|
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("updated"))))
|
|
||||||
{
|
|
||||||
utility::datetime refVal_setUpdated;
|
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("updated"))), refVal_setUpdated );
|
|
||||||
setUpdated(refVal_setUpdated);
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
utility::string_t Subscription::getId() const
|
|
||||||
{
|
|
||||||
return m_Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Subscription::setId(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Id = value;
|
|
||||||
m_IdIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::idIsSet() const
|
|
||||||
{
|
|
||||||
return m_IdIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::unsetId()
|
|
||||||
{
|
|
||||||
m_IdIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t Subscription::getName() const
|
|
||||||
{
|
|
||||||
return m_Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Subscription::setName(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Name = value;
|
|
||||||
m_NameIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::nameIsSet() const
|
|
||||||
{
|
|
||||||
return m_NameIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::unsetName()
|
|
||||||
{
|
|
||||||
m_NameIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t Subscription::getDescription() const
|
|
||||||
{
|
|
||||||
return m_Description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Subscription::setDescription(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Description = value;
|
|
||||||
m_DescriptionIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::descriptionIsSet() const
|
|
||||||
{
|
|
||||||
return m_DescriptionIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::unsetDescription()
|
|
||||||
{
|
|
||||||
m_DescriptionIsSet = false;
|
|
||||||
}
|
|
||||||
utility::string_t Subscription::getImageUrl() const
|
|
||||||
{
|
|
||||||
return m_Image_url;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Subscription::setImageUrl(const utility::string_t& value)
|
|
||||||
{
|
|
||||||
m_Image_url = value;
|
|
||||||
m_Image_urlIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::imageUrlIsSet() const
|
|
||||||
{
|
|
||||||
return m_Image_urlIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::unsetImage_url()
|
|
||||||
{
|
|
||||||
m_Image_urlIsSet = false;
|
|
||||||
}
|
|
||||||
std::map<utility::string_t, double> Subscription::getPrices() const
|
|
||||||
{
|
|
||||||
return m_Prices;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::setPrices(std::map<utility::string_t, double> value)
|
|
||||||
{
|
|
||||||
m_Prices = value;
|
|
||||||
m_PricesIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::pricesIsSet() const
|
|
||||||
{
|
|
||||||
return m_PricesIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::unsetPrices()
|
|
||||||
{
|
|
||||||
m_PricesIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime Subscription::getCreated() const
|
|
||||||
{
|
|
||||||
return m_Created;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Subscription::setCreated(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Created = value;
|
|
||||||
m_CreatedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::createdIsSet() const
|
|
||||||
{
|
|
||||||
return m_CreatedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::unsetCreated()
|
|
||||||
{
|
|
||||||
m_CreatedIsSet = false;
|
|
||||||
}
|
|
||||||
utility::datetime Subscription::getUpdated() const
|
|
||||||
{
|
|
||||||
return m_Updated;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Subscription::setUpdated(const utility::datetime& value)
|
|
||||||
{
|
|
||||||
m_Updated = value;
|
|
||||||
m_UpdatedIsSet = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Subscription::updatedIsSet() const
|
|
||||||
{
|
|
||||||
return m_UpdatedIsSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Subscription::unsetUpdated()
|
|
||||||
{
|
|
||||||
m_UpdatedIsSet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,109 +10,108 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "tribufu++/model/TokenHintType.h"
|
#include "tribufu++/model/TokenHintType.h"
|
||||||
|
|
||||||
namespace tribufu {
|
namespace tribufu
|
||||||
namespace models {
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
{
|
||||||
using EnumUnderlyingType = utility::string_t;
|
namespace models
|
||||||
|
|
||||||
TokenHintType::eTokenHintType toEnum(const EnumUnderlyingType& val)
|
|
||||||
{
|
|
||||||
if (val == utility::conversions::to_string_t(U("access_token")))
|
|
||||||
return TokenHintType::eTokenHintType::TokenHintType_ACCESS_TOKEN;
|
|
||||||
if (val == utility::conversions::to_string_t(U("refresh_token")))
|
|
||||||
return TokenHintType::eTokenHintType::TokenHintType_REFRESH_TOKEN;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumUnderlyingType fromEnum(TokenHintType::eTokenHintType e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
{
|
||||||
case TokenHintType::eTokenHintType::TokenHintType_ACCESS_TOKEN:
|
|
||||||
return U("access_token");
|
|
||||||
case TokenHintType::eTokenHintType::TokenHintType_REFRESH_TOKEN:
|
|
||||||
return U("refresh_token");
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TokenHintType::TokenHintType()
|
namespace
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
TokenHintType::~TokenHintType()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void TokenHintType::validate()
|
|
||||||
{
|
|
||||||
// TODO: implement validation
|
|
||||||
}
|
|
||||||
|
|
||||||
web::json::value TokenHintType::toJson() const
|
|
||||||
{
|
|
||||||
auto val = fromEnum(m_value);
|
|
||||||
return web::json::value(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TokenHintType::fromJson(const web::json::value& val)
|
|
||||||
{
|
|
||||||
m_value = toEnum(val.as_string());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TokenHintType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix) const
|
|
||||||
{
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto e = fromEnum(m_value);
|
|
||||||
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TokenHintType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& prefix)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
utility::string_t namePrefix = prefix;
|
|
||||||
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
|
||||||
{
|
|
||||||
namePrefix.push_back(U('.'));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
EnumUnderlyingType e;
|
|
||||||
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
auto v = toEnum(e);
|
using EnumUnderlyingType = utility::string_t;
|
||||||
setValue(v);
|
|
||||||
|
TokenHintType::eTokenHintType toEnum(const EnumUnderlyingType &val)
|
||||||
|
{
|
||||||
|
if (val == utility::conversions::to_string_t(U("access_token")))
|
||||||
|
return TokenHintType::eTokenHintType::TokenHintType_ACCESS_TOKEN;
|
||||||
|
if (val == utility::conversions::to_string_t(U("refresh_token")))
|
||||||
|
return TokenHintType::eTokenHintType::TokenHintType_REFRESH_TOKEN;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumUnderlyingType fromEnum(TokenHintType::eTokenHintType e)
|
||||||
|
{
|
||||||
|
switch (e)
|
||||||
|
{
|
||||||
|
case TokenHintType::eTokenHintType::TokenHintType_ACCESS_TOKEN:
|
||||||
|
return U("access_token");
|
||||||
|
case TokenHintType::eTokenHintType::TokenHintType_REFRESH_TOKEN:
|
||||||
|
return U("refresh_token");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TokenHintType::TokenHintType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
TokenHintType::~TokenHintType()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void TokenHintType::validate()
|
||||||
|
{
|
||||||
|
// TODO: implement validation
|
||||||
|
}
|
||||||
|
|
||||||
|
web::json::value TokenHintType::toJson() const
|
||||||
|
{
|
||||||
|
auto val = fromEnum(m_value);
|
||||||
|
return web::json::value(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TokenHintType::fromJson(const web::json::value &val)
|
||||||
|
{
|
||||||
|
m_value = toEnum(val.as_string());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TokenHintType::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||||
|
const utility::string_t &prefix) const
|
||||||
|
{
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
auto e = fromEnum(m_value);
|
||||||
|
multipart->add(ModelBase::toHttpContent(namePrefix, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TokenHintType::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
utility::string_t namePrefix = prefix;
|
||||||
|
if (!namePrefix.empty() && namePrefix.back() != U('.'))
|
||||||
|
{
|
||||||
|
namePrefix.push_back(U('.'));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
EnumUnderlyingType e;
|
||||||
|
ok = ModelBase::fromHttpContent(multipart->getContent(namePrefix), e);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
auto v = toEnum(e);
|
||||||
|
setValue(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
TokenHintType::eTokenHintType TokenHintType::getValue() const
|
||||||
|
{
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TokenHintType::setValue(TokenHintType::eTokenHintType const value)
|
||||||
|
{
|
||||||
|
m_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenHintType::eTokenHintType TokenHintType::getValue() const
|
|
||||||
{
|
|
||||||
return m_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TokenHintType::setValue(TokenHintType::eTokenHintType const value)
|
|
||||||
{
|
|
||||||
m_value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user