mirror of
https://github.com/tribufu/sdk-cpp
synced 2025-06-15 11:24:18 +00:00
Format c++ files on generation
This commit is contained in:
@ -19,37 +19,39 @@
|
||||
#ifndef TRIBUFU_MODELS_AnyType_H_
|
||||
#define TRIBUFU_MODELS_AnyType_H_
|
||||
|
||||
|
||||
#include "tribufu++/Object.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <cpprest/json.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
namespace tribufu
|
||||
{
|
||||
namespace models
|
||||
{
|
||||
|
||||
class AnyType : public Object {
|
||||
public:
|
||||
AnyType();
|
||||
virtual ~AnyType();
|
||||
class AnyType : public Object
|
||||
{
|
||||
public:
|
||||
AnyType();
|
||||
virtual ~AnyType();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value &json) 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;
|
||||
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;
|
||||
|
||||
private:
|
||||
web::json::value m_value;
|
||||
};
|
||||
private:
|
||||
web::json::value m_value;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_AnyType_H_ */
|
||||
|
@ -19,93 +19,87 @@
|
||||
#ifndef TRIBUFU_API_ApiClient_H_
|
||||
#define TRIBUFU_API_ApiClient_H_
|
||||
|
||||
|
||||
#include "tribufu++/ApiConfiguration.h"
|
||||
#include "tribufu++/ApiException.h"
|
||||
#include "tribufu++/IHttpBody.h"
|
||||
#include "tribufu++/HttpContent.h"
|
||||
#include "tribufu++/IHttpBody.h"
|
||||
|
||||
#if defined (_WIN32) || defined (_WIN64)
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#undef U
|
||||
#endif
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <cpprest/http_client.h>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
namespace tribufu {
|
||||
namespace api {
|
||||
|
||||
using namespace tribufu::models;
|
||||
|
||||
class ApiClient
|
||||
namespace tribufu
|
||||
{
|
||||
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++)
|
||||
namespace api
|
||||
{
|
||||
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_ */
|
||||
|
@ -19,45 +19,45 @@
|
||||
#ifndef TRIBUFU_API_ApiConfiguration_H_
|
||||
#define TRIBUFU_API_ApiConfiguration_H_
|
||||
|
||||
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <cpprest/http_client.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace tribufu {
|
||||
namespace api {
|
||||
|
||||
class ApiConfiguration
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
ApiConfiguration();
|
||||
virtual ~ApiConfiguration();
|
||||
namespace api
|
||||
{
|
||||
|
||||
const web::http::client::http_client_config& getHttpConfig() const;
|
||||
void setHttpConfig( web::http::client::http_client_config& value );
|
||||
class ApiConfiguration
|
||||
{
|
||||
public:
|
||||
ApiConfiguration();
|
||||
virtual ~ApiConfiguration();
|
||||
|
||||
utility::string_t getBaseUrl() const;
|
||||
void setBaseUrl( const utility::string_t value );
|
||||
const web::http::client::http_client_config &getHttpConfig() const;
|
||||
void setHttpConfig(web::http::client::http_client_config &value);
|
||||
|
||||
utility::string_t getUserAgent() const;
|
||||
void setUserAgent( const utility::string_t value );
|
||||
utility::string_t getBaseUrl() const;
|
||||
void setBaseUrl(const utility::string_t value);
|
||||
|
||||
std::map<utility::string_t, utility::string_t>& getDefaultHeaders();
|
||||
const std::map<utility::string_t, utility::string_t>& getDefaultHeaders() const;
|
||||
utility::string_t getUserAgent() const;
|
||||
void setUserAgent(const utility::string_t value);
|
||||
|
||||
utility::string_t getApiKey( const utility::string_t& prefix) const;
|
||||
void setApiKey( const utility::string_t& prefix, const utility::string_t& apiKey );
|
||||
std::map<utility::string_t, utility::string_t> &getDefaultHeaders();
|
||||
const std::map<utility::string_t, utility::string_t> &getDefaultHeaders() const;
|
||||
|
||||
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;
|
||||
};
|
||||
utility::string_t getApiKey(const utility::string_t &prefix) const;
|
||||
void setApiKey(const utility::string_t &prefix, const utility::string_t &apiKey);
|
||||
|
||||
}
|
||||
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_ */
|
||||
|
@ -19,39 +19,36 @@
|
||||
#ifndef TRIBUFU_API_ApiException_H_
|
||||
#define TRIBUFU_API_ApiException_H_
|
||||
|
||||
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <cpprest/http_msg.h>
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
namespace tribufu {
|
||||
namespace api {
|
||||
|
||||
class ApiException
|
||||
: public web::http::http_exception
|
||||
namespace tribufu
|
||||
{
|
||||
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();
|
||||
namespace api
|
||||
{
|
||||
|
||||
std::map<utility::string_t, utility::string_t>& getHeaders();
|
||||
std::shared_ptr<std::istream> getContent() const;
|
||||
class ApiException : public web::http::http_exception
|
||||
{
|
||||
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::shared_ptr<std::istream> m_Content;
|
||||
std::map<utility::string_t, utility::string_t> m_Headers;
|
||||
};
|
||||
std::map<utility::string_t, utility::string_t> &getHeaders();
|
||||
std::shared_ptr<std::istream> getContent() const;
|
||||
|
||||
}
|
||||
protected:
|
||||
std::shared_ptr<std::istream> m_Content;
|
||||
std::map<utility::string_t, utility::string_t> m_Headers;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_API_ApiBase_H_ */
|
||||
|
@ -19,48 +19,48 @@
|
||||
#ifndef TRIBUFU_MODELS_HttpContent_H_
|
||||
#define TRIBUFU_MODELS_HttpContent_H_
|
||||
|
||||
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class HttpContent
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
HttpContent();
|
||||
virtual ~HttpContent();
|
||||
namespace models
|
||||
{
|
||||
|
||||
virtual utility::string_t getContentDisposition() const;
|
||||
virtual void setContentDisposition( const utility::string_t& value );
|
||||
class HttpContent
|
||||
{
|
||||
public:
|
||||
HttpContent();
|
||||
virtual ~HttpContent();
|
||||
|
||||
virtual utility::string_t getName() const;
|
||||
virtual void setName( const utility::string_t& value );
|
||||
virtual utility::string_t getContentDisposition() const;
|
||||
virtual void setContentDisposition(const utility::string_t &value);
|
||||
|
||||
virtual utility::string_t getFileName() const;
|
||||
virtual void setFileName( const utility::string_t& value );
|
||||
virtual utility::string_t getName() const;
|
||||
virtual void setName(const utility::string_t &value);
|
||||
|
||||
virtual utility::string_t getContentType() const;
|
||||
virtual void setContentType( const utility::string_t& value );
|
||||
virtual utility::string_t getFileName() const;
|
||||
virtual void setFileName(const utility::string_t &value);
|
||||
|
||||
virtual std::shared_ptr<std::istream> getData() const;
|
||||
virtual void setData( std::shared_ptr<std::istream> value );
|
||||
virtual utility::string_t getContentType() const;
|
||||
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:
|
||||
// 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;
|
||||
};
|
||||
virtual void writeTo(std::ostream &stream);
|
||||
|
||||
}
|
||||
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_ */
|
||||
|
@ -19,21 +19,24 @@
|
||||
#ifndef TRIBUFU_MODELS_IHttpBody_H_
|
||||
#define TRIBUFU_MODELS_IHttpBody_H_
|
||||
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class IHttpBody
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
virtual ~IHttpBody() { }
|
||||
namespace models
|
||||
{
|
||||
|
||||
virtual void writeTo( std::ostream& stream ) = 0;
|
||||
};
|
||||
class IHttpBody
|
||||
{
|
||||
public:
|
||||
virtual ~IHttpBody()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
virtual void writeTo(std::ostream &stream) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_IHttpBody_H_ */
|
||||
|
@ -19,28 +19,28 @@
|
||||
#ifndef TRIBUFU_MODELS_JsonBody_H_
|
||||
#define TRIBUFU_MODELS_JsonBody_H_
|
||||
|
||||
|
||||
#include "tribufu++/IHttpBody.h"
|
||||
|
||||
#include <cpprest/json.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class JsonBody
|
||||
: public IHttpBody
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
JsonBody( const web::json::value& value );
|
||||
virtual ~JsonBody();
|
||||
namespace models
|
||||
{
|
||||
|
||||
void writeTo( std::ostream& target ) override;
|
||||
class JsonBody : public IHttpBody
|
||||
{
|
||||
public:
|
||||
JsonBody(const web::json::value &value);
|
||||
virtual ~JsonBody();
|
||||
|
||||
protected:
|
||||
web::json::value m_Json;
|
||||
};
|
||||
void writeTo(std::ostream &target) override;
|
||||
|
||||
}
|
||||
protected:
|
||||
web::json::value m_Json;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_JsonBody_H_ */
|
||||
|
@ -19,8 +19,6 @@
|
||||
#ifndef TRIBUFU_MODELS_ModelBase_H_
|
||||
#define TRIBUFU_MODELS_ModelBase_H_
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/HttpContent.h"
|
||||
#include "tribufu++/MultipartFormData.h"
|
||||
|
||||
@ -31,472 +29,485 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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 )
|
||||
namespace models
|
||||
{
|
||||
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())
|
||||
class ModelBase
|
||||
{
|
||||
T item;
|
||||
ok &= fromJson(jitem, item);
|
||||
outVal.push_back(item);
|
||||
public:
|
||||
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
|
||||
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_ */
|
||||
|
@ -19,40 +19,40 @@
|
||||
#ifndef TRIBUFU_MODELS_MultipartFormData_H_
|
||||
#define TRIBUFU_MODELS_MultipartFormData_H_
|
||||
|
||||
|
||||
#include "tribufu++/IHttpBody.h"
|
||||
#include "tribufu++/HttpContent.h"
|
||||
#include "tribufu++/IHttpBody.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class MultipartFormData
|
||||
: public IHttpBody
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
MultipartFormData();
|
||||
MultipartFormData(const utility::string_t& boundary);
|
||||
virtual ~MultipartFormData();
|
||||
namespace models
|
||||
{
|
||||
|
||||
virtual void add( std::shared_ptr<HttpContent> content );
|
||||
virtual utility::string_t getBoundary();
|
||||
virtual std::shared_ptr<HttpContent> getContent(const utility::string_t& name) const;
|
||||
virtual bool hasContent(const utility::string_t& name) const;
|
||||
virtual void writeTo( std::ostream& target );
|
||||
class MultipartFormData : public IHttpBody
|
||||
{
|
||||
public:
|
||||
MultipartFormData();
|
||||
MultipartFormData(const utility::string_t &boundary);
|
||||
virtual ~MultipartFormData();
|
||||
|
||||
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;
|
||||
};
|
||||
virtual void add(std::shared_ptr<HttpContent> content);
|
||||
virtual utility::string_t getBoundary();
|
||||
virtual std::shared_ptr<HttpContent> getContent(const utility::string_t &name) const;
|
||||
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_ */
|
||||
|
@ -19,41 +19,44 @@
|
||||
#ifndef TRIBUFU_MODELS_Object_H_
|
||||
#define TRIBUFU_MODELS_Object_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <cpprest/json.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class Object : public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Object();
|
||||
virtual ~Object();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
void validate() override;
|
||||
class Object : public ModelBase
|
||||
{
|
||||
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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Object manipulation
|
||||
web::json::value getValue(const utility::string_t& key) const;
|
||||
void setValue(const utility::string_t& key, const web::json::value& value);
|
||||
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;
|
||||
|
||||
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_ */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* Account.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_Account_H_
|
||||
@ -23,108 +23,104 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/AnyType.h"
|
||||
#include "tribufu++/model/LoginProvider.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class Account
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Account();
|
||||
virtual ~Account();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class Account : public ModelBase
|
||||
{
|
||||
public:
|
||||
Account();
|
||||
virtual ~Account();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
std::shared_ptr<LoginProvider> getProvider() const;
|
||||
bool providerIsSet() const;
|
||||
void unsetProvider();
|
||||
void setProvider(const std::shared_ptr<LoginProvider> &value);
|
||||
|
||||
std::shared_ptr<LoginProvider> getProvider() const;
|
||||
bool providerIsSet() const;
|
||||
void unsetProvider();
|
||||
void setProvider(const std::shared_ptr<LoginProvider>& value);
|
||||
utility::string_t getUserId() const;
|
||||
bool userIdIsSet() const;
|
||||
void unsetUser_id();
|
||||
void setUserId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getUserId() const;
|
||||
bool userIdIsSet() const;
|
||||
void unsetUser_id();
|
||||
void setUserId(const utility::string_t& value);
|
||||
bool isAuthorized() const;
|
||||
bool authorizedIsSet() const;
|
||||
void unsetAuthorized();
|
||||
void setAuthorized(bool value);
|
||||
|
||||
bool isAuthorized() const;
|
||||
bool authorizedIsSet() const;
|
||||
void unsetAuthorized();
|
||||
void setAuthorized(bool value);
|
||||
std::shared_ptr<AnyType> getFields() const;
|
||||
bool fieldsIsSet() const;
|
||||
void unsetFields();
|
||||
void setFields(const std::shared_ptr<AnyType> &value);
|
||||
|
||||
std::shared_ptr<AnyType> getFields() const;
|
||||
bool fieldsIsSet() const;
|
||||
void unsetFields();
|
||||
void setFields(const std::shared_ptr<AnyType>& value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
std::shared_ptr<LoginProvider> m_Provider;
|
||||
bool m_ProviderIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_User_id;
|
||||
bool m_User_idIsSet;
|
||||
|
||||
std::shared_ptr<LoginProvider> m_Provider;
|
||||
bool m_ProviderIsSet;
|
||||
bool m_Authorized;
|
||||
bool m_AuthorizedIsSet;
|
||||
|
||||
utility::string_t m_User_id;
|
||||
bool m_User_idIsSet;
|
||||
std::shared_ptr<AnyType> m_Fields;
|
||||
bool m_FieldsIsSet;
|
||||
|
||||
bool m_Authorized;
|
||||
bool m_AuthorizedIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
std::shared_ptr<AnyType> m_Fields;
|
||||
bool m_FieldsIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_Account_H_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* Application.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_Application_H_
|
||||
@ -23,203 +23,199 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/ApplicationType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class Application
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Application();
|
||||
virtual ~Application();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class Application : public ModelBase
|
||||
{
|
||||
public:
|
||||
Application();
|
||||
virtual ~Application();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t& value);
|
||||
std::shared_ptr<ApplicationType> getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(const std::shared_ptr<ApplicationType> &value);
|
||||
|
||||
std::shared_ptr<ApplicationType> getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(const std::shared_ptr<ApplicationType>& value);
|
||||
utility::string_t getOrganizationId() const;
|
||||
bool organizationIdIsSet() const;
|
||||
void unsetOrganization_id();
|
||||
void setOrganizationId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getOrganizationId() const;
|
||||
bool organizationIdIsSet() const;
|
||||
void unsetOrganization_id();
|
||||
void setOrganizationId(const utility::string_t& value);
|
||||
utility::string_t getIconUrl() const;
|
||||
bool iconUrlIsSet() const;
|
||||
void unsetIcon_url();
|
||||
void setIconUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getIconUrl() const;
|
||||
bool iconUrlIsSet() const;
|
||||
void unsetIcon_url();
|
||||
void setIconUrl(const utility::string_t& value);
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t& value);
|
||||
utility::string_t getCapsuleImageUrl() const;
|
||||
bool capsuleImageUrlIsSet() const;
|
||||
void unsetCapsule_image_url();
|
||||
void setCapsuleImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCapsuleImageUrl() const;
|
||||
bool capsuleImageUrlIsSet() const;
|
||||
void unsetCapsule_image_url();
|
||||
void setCapsuleImageUrl(const utility::string_t& value);
|
||||
utility::string_t getLibraryImageUrl() const;
|
||||
bool libraryImageUrlIsSet() const;
|
||||
void unsetLibrary_image_url();
|
||||
void setLibraryImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getLibraryImageUrl() const;
|
||||
bool libraryImageUrlIsSet() const;
|
||||
void unsetLibrary_image_url();
|
||||
void setLibraryImageUrl(const utility::string_t& value);
|
||||
utility::string_t getParentId() const;
|
||||
bool parentIdIsSet() const;
|
||||
void unsetParent_id();
|
||||
void setParentId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getParentId() const;
|
||||
bool parentIdIsSet() const;
|
||||
void unsetParent_id();
|
||||
void setParentId(const utility::string_t& value);
|
||||
utility::string_t getSlug() const;
|
||||
bool slugIsSet() const;
|
||||
void unsetSlug();
|
||||
void setSlug(const utility::string_t &value);
|
||||
|
||||
utility::string_t getSlug() const;
|
||||
bool slugIsSet() const;
|
||||
void unsetSlug();
|
||||
void setSlug(const utility::string_t& value);
|
||||
int32_t getVisibility() const;
|
||||
bool visibilityIsSet() const;
|
||||
void unsetVisibility();
|
||||
void setVisibility(int32_t value);
|
||||
|
||||
int32_t getVisibility() const;
|
||||
bool visibilityIsSet() const;
|
||||
void unsetVisibility();
|
||||
void setVisibility(int32_t value);
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_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;
|
||||
bool primaryIsSet() const;
|
||||
void unsetPrimary();
|
||||
void setPrimary(int32_t value);
|
||||
int32_t getUserCount() const;
|
||||
bool userCountIsSet() const;
|
||||
void unsetUser_count();
|
||||
void setUserCount(int32_t value);
|
||||
|
||||
int32_t getUserCount() const;
|
||||
bool userCountIsSet() const;
|
||||
void unsetUser_count();
|
||||
void setUserCount(int32_t value);
|
||||
int32_t getAchievementCount() const;
|
||||
bool achievementCountIsSet() const;
|
||||
void unsetAchievement_count();
|
||||
void setAchievementCount(int32_t value);
|
||||
|
||||
int32_t getAchievementCount() const;
|
||||
bool achievementCountIsSet() const;
|
||||
void unsetAchievement_count();
|
||||
void setAchievementCount(int32_t value);
|
||||
int32_t getBadgeCount() const;
|
||||
bool badgeCountIsSet() const;
|
||||
void unsetBadge_count();
|
||||
void setBadgeCount(int32_t value);
|
||||
|
||||
int32_t getBadgeCount() const;
|
||||
bool badgeCountIsSet() const;
|
||||
void unsetBadge_count();
|
||||
void setBadgeCount(int32_t value);
|
||||
int32_t getDownloadCount() const;
|
||||
bool downloadCountIsSet() const;
|
||||
void unsetDownload_count();
|
||||
void setDownloadCount(int32_t value);
|
||||
|
||||
int32_t getDownloadCount() const;
|
||||
bool downloadCountIsSet() const;
|
||||
void unsetDownload_count();
|
||||
void setDownloadCount(int32_t value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
std::shared_ptr<ApplicationType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
utility::string_t m_Organization_id;
|
||||
bool m_Organization_idIsSet;
|
||||
|
||||
std::shared_ptr<ApplicationType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
utility::string_t m_Icon_url;
|
||||
bool m_Icon_urlIsSet;
|
||||
|
||||
utility::string_t m_Organization_id;
|
||||
bool m_Organization_idIsSet;
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
|
||||
utility::string_t m_Icon_url;
|
||||
bool m_Icon_urlIsSet;
|
||||
utility::string_t m_Capsule_image_url;
|
||||
bool m_Capsule_image_urlIsSet;
|
||||
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
utility::string_t m_Library_image_url;
|
||||
bool m_Library_image_urlIsSet;
|
||||
|
||||
utility::string_t m_Capsule_image_url;
|
||||
bool m_Capsule_image_urlIsSet;
|
||||
utility::string_t m_Parent_id;
|
||||
bool m_Parent_idIsSet;
|
||||
|
||||
utility::string_t m_Library_image_url;
|
||||
bool m_Library_image_urlIsSet;
|
||||
utility::string_t m_Slug;
|
||||
bool m_SlugIsSet;
|
||||
|
||||
utility::string_t m_Parent_id;
|
||||
bool m_Parent_idIsSet;
|
||||
int32_t m_Visibility;
|
||||
bool m_VisibilityIsSet;
|
||||
|
||||
utility::string_t m_Slug;
|
||||
bool m_SlugIsSet;
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
|
||||
int32_t m_Visibility;
|
||||
bool m_VisibilityIsSet;
|
||||
int32_t m_Primary;
|
||||
bool m_PrimaryIsSet;
|
||||
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
int32_t m_User_count;
|
||||
bool m_User_countIsSet;
|
||||
|
||||
int32_t m_Primary;
|
||||
bool m_PrimaryIsSet;
|
||||
int32_t m_Achievement_count;
|
||||
bool m_Achievement_countIsSet;
|
||||
|
||||
int32_t m_User_count;
|
||||
bool m_User_countIsSet;
|
||||
int32_t m_Badge_count;
|
||||
bool m_Badge_countIsSet;
|
||||
|
||||
int32_t m_Achievement_count;
|
||||
bool m_Achievement_countIsSet;
|
||||
int32_t m_Download_count;
|
||||
bool m_Download_countIsSet;
|
||||
|
||||
int32_t m_Badge_count;
|
||||
bool m_Badge_countIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
int32_t m_Download_count;
|
||||
bool m_Download_countIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_Application_H_ */
|
||||
|
@ -13,52 +13,52 @@
|
||||
/*
|
||||
* ApplicationType.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_ApplicationType_H_
|
||||
#define TRIBUFU_MODELS_ApplicationType_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class ApplicationType
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
ApplicationType_APPLICATION,
|
||||
ApplicationType_GAME,
|
||||
};
|
||||
|
||||
eApplicationType getValue() const;
|
||||
void setValue(eApplicationType const value);
|
||||
class ApplicationType : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* AuthorizeRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_AuthorizeRequest_H_
|
||||
@ -23,100 +23,96 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include "tribufu++/model/CodeChallengeMethod.h"
|
||||
#include "tribufu++/model/ResponseType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/CodeChallengeMethod.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class AuthorizeRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
AuthorizeRequest();
|
||||
virtual ~AuthorizeRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class AuthorizeRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
AuthorizeRequest();
|
||||
virtual ~AuthorizeRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool responseTypeIsSet() const;
|
||||
void unsetResponse_type();
|
||||
void setResponseType(const std::shared_ptr<ResponseType>& value);
|
||||
utility::string_t getClientId() const;
|
||||
bool clientIdIsSet() const;
|
||||
void unsetClient_id();
|
||||
void setClientId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getClientId() const;
|
||||
bool clientIdIsSet() const;
|
||||
void unsetClient_id();
|
||||
void setClientId(const utility::string_t& value);
|
||||
utility::string_t getCodeChallenge() const;
|
||||
bool codeChallengeIsSet() const;
|
||||
void unsetCode_challenge();
|
||||
void setCodeChallenge(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCodeChallenge() const;
|
||||
bool codeChallengeIsSet() const;
|
||||
void unsetCode_challenge();
|
||||
void setCodeChallenge(const utility::string_t& value);
|
||||
std::shared_ptr<CodeChallengeMethod> getCodeChallengeMethod() const;
|
||||
bool codeChallengeMethodIsSet() const;
|
||||
void unsetCode_challenge_method();
|
||||
void setCodeChallengeMethod(const std::shared_ptr<CodeChallengeMethod> &value);
|
||||
|
||||
std::shared_ptr<CodeChallengeMethod> getCodeChallengeMethod() const;
|
||||
bool codeChallengeMethodIsSet() const;
|
||||
void unsetCode_challenge_method();
|
||||
void setCodeChallengeMethod(const std::shared_ptr<CodeChallengeMethod>& value);
|
||||
utility::string_t getRedirectUri() const;
|
||||
bool redirectUriIsSet() const;
|
||||
void unsetRedirect_uri();
|
||||
void setRedirectUri(const utility::string_t &value);
|
||||
|
||||
utility::string_t getRedirectUri() const;
|
||||
bool redirectUriIsSet() const;
|
||||
void unsetRedirect_uri();
|
||||
void setRedirectUri(const utility::string_t& value);
|
||||
utility::string_t getScope() const;
|
||||
bool scopeIsSet() const;
|
||||
void unsetScope();
|
||||
void setScope(const utility::string_t &value);
|
||||
|
||||
utility::string_t getScope() const;
|
||||
bool scopeIsSet() const;
|
||||
void unsetScope();
|
||||
void setScope(const utility::string_t& value);
|
||||
utility::string_t getState() const;
|
||||
bool stateIsSet() const;
|
||||
void unsetState();
|
||||
void setState(const utility::string_t &value);
|
||||
|
||||
utility::string_t getState() const;
|
||||
bool stateIsSet() const;
|
||||
void unsetState();
|
||||
void setState(const utility::string_t& value);
|
||||
protected:
|
||||
std::shared_ptr<ResponseType> m_Response_type;
|
||||
bool m_Response_typeIsSet;
|
||||
|
||||
utility::string_t m_Client_id;
|
||||
bool m_Client_idIsSet;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ResponseType> m_Response_type;
|
||||
bool m_Response_typeIsSet;
|
||||
utility::string_t m_Code_challenge;
|
||||
bool m_Code_challengeIsSet;
|
||||
|
||||
utility::string_t m_Client_id;
|
||||
bool m_Client_idIsSet;
|
||||
std::shared_ptr<CodeChallengeMethod> m_Code_challenge_method;
|
||||
bool m_Code_challenge_methodIsSet;
|
||||
|
||||
utility::string_t m_Code_challenge;
|
||||
bool m_Code_challengeIsSet;
|
||||
utility::string_t m_Redirect_uri;
|
||||
bool m_Redirect_uriIsSet;
|
||||
|
||||
std::shared_ptr<CodeChallengeMethod> m_Code_challenge_method;
|
||||
bool m_Code_challenge_methodIsSet;
|
||||
utility::string_t m_Scope;
|
||||
bool m_ScopeIsSet;
|
||||
|
||||
utility::string_t m_Redirect_uri;
|
||||
bool m_Redirect_uriIsSet;
|
||||
utility::string_t m_State;
|
||||
bool m_StateIsSet;
|
||||
};
|
||||
|
||||
utility::string_t m_Scope;
|
||||
bool m_ScopeIsSet;
|
||||
|
||||
utility::string_t m_State;
|
||||
bool m_StateIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_AuthorizeRequest_H_ */
|
||||
|
@ -13,52 +13,52 @@
|
||||
/*
|
||||
* CodeChallengeMethod.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_CodeChallengeMethod_H_
|
||||
#define TRIBUFU_MODELS_CodeChallengeMethod_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class CodeChallengeMethod
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
CodeChallengeMethod_PLAIN,
|
||||
CodeChallengeMethod_S256,
|
||||
};
|
||||
|
||||
eCodeChallengeMethod getValue() const;
|
||||
void setValue(eCodeChallengeMethod const value);
|
||||
class CodeChallengeMethod : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,67 +13,62 @@
|
||||
/*
|
||||
* CryptoViewModel.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_CryptoViewModel_H_
|
||||
#define TRIBUFU_MODELS_CryptoViewModel_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class CryptoViewModel
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
CryptoViewModel();
|
||||
virtual ~CryptoViewModel();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class CryptoViewModel : public ModelBase
|
||||
{
|
||||
public:
|
||||
CryptoViewModel();
|
||||
virtual ~CryptoViewModel();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool encodedIsSet() const;
|
||||
void unsetEncoded();
|
||||
void setEncoded(const utility::string_t& value);
|
||||
utility::string_t getDecoded() const;
|
||||
bool decodedIsSet() const;
|
||||
void unsetDecoded();
|
||||
void setDecoded(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDecoded() const;
|
||||
bool decodedIsSet() const;
|
||||
void unsetDecoded();
|
||||
void setDecoded(const utility::string_t& value);
|
||||
protected:
|
||||
utility::string_t m_Encoded;
|
||||
bool m_EncodedIsSet;
|
||||
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* Game.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_Game_H_
|
||||
@ -23,291 +23,287 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/ApplicationType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class Game
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Game();
|
||||
virtual ~Game();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Game members
|
||||
|
||||
|
||||
int32_t getGamePort() const;
|
||||
bool gamePortIsSet() const;
|
||||
void unsetGame_port();
|
||||
void setGamePort(int32_t value);
|
||||
|
||||
int32_t getQueryPort() const;
|
||||
bool queryPortIsSet() const;
|
||||
void unsetQuery_port();
|
||||
void setQueryPort(int32_t value);
|
||||
|
||||
int32_t getRconPort() const;
|
||||
bool rconPortIsSet() const;
|
||||
void unsetRcon_port();
|
||||
void setRconPort(int32_t value);
|
||||
|
||||
int32_t getServerCount() const;
|
||||
bool serverCountIsSet() const;
|
||||
void unsetServer_count();
|
||||
void setServerCount(int32_t value);
|
||||
|
||||
int32_t getSteamAppId() const;
|
||||
bool steamAppIdIsSet() const;
|
||||
void unsetSteam_app_id();
|
||||
void setSteamAppId(int32_t value);
|
||||
|
||||
int32_t getSteamServerAppId() const;
|
||||
bool steamServerAppIdIsSet() const;
|
||||
void unsetSteam_server_app_id();
|
||||
void setSteamServerAppId(int32_t value);
|
||||
|
||||
bool isEnableServers() const;
|
||||
bool enableServersIsSet() const;
|
||||
void unsetEnable_servers();
|
||||
void setEnableServers(bool value);
|
||||
|
||||
utility::string_t getRustGamedigId() const;
|
||||
bool rustGamedigIdIsSet() const;
|
||||
void unsetRust_gamedig_id();
|
||||
void setRustGamedigId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getNodeGamedigId() const;
|
||||
bool nodeGamedigIdIsSet() const;
|
||||
void unsetNode_gamedig_id();
|
||||
void setNodeGamedigId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getServerConnectUrl() const;
|
||||
bool serverConnectUrlIsSet() const;
|
||||
void unsetServer_connect_url();
|
||||
void setServerConnectUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getServerTags() const;
|
||||
bool serverTagsIsSet() const;
|
||||
void unsetServer_tags();
|
||||
void setServerTags(const utility::string_t& value);
|
||||
|
||||
utility::string_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t& value);
|
||||
|
||||
std::shared_ptr<ApplicationType> getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(const std::shared_ptr<ApplicationType>& value);
|
||||
|
||||
utility::string_t getOrganizationId() const;
|
||||
bool organizationIdIsSet() const;
|
||||
void unsetOrganization_id();
|
||||
void setOrganizationId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getIconUrl() const;
|
||||
bool iconUrlIsSet() const;
|
||||
void unsetIcon_url();
|
||||
void setIconUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getCapsuleImageUrl() const;
|
||||
bool capsuleImageUrlIsSet() const;
|
||||
void unsetCapsule_image_url();
|
||||
void setCapsuleImageUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getLibraryImageUrl() const;
|
||||
bool libraryImageUrlIsSet() const;
|
||||
void unsetLibrary_image_url();
|
||||
void setLibraryImageUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getParentId() const;
|
||||
bool parentIdIsSet() const;
|
||||
void unsetParent_id();
|
||||
void setParentId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getSlug() const;
|
||||
bool slugIsSet() const;
|
||||
void unsetSlug();
|
||||
void setSlug(const utility::string_t& value);
|
||||
|
||||
int32_t getVisibility() const;
|
||||
bool visibilityIsSet() const;
|
||||
void unsetVisibility();
|
||||
void setVisibility(int32_t value);
|
||||
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_t& value);
|
||||
namespace models
|
||||
{
|
||||
|
||||
class Game : public ModelBase
|
||||
{
|
||||
public:
|
||||
Game();
|
||||
virtual ~Game();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Game members
|
||||
|
||||
int32_t getGamePort() const;
|
||||
bool gamePortIsSet() const;
|
||||
void unsetGame_port();
|
||||
void setGamePort(int32_t value);
|
||||
|
||||
int32_t getQueryPort() const;
|
||||
bool queryPortIsSet() const;
|
||||
void unsetQuery_port();
|
||||
void setQueryPort(int32_t value);
|
||||
|
||||
int32_t getRconPort() const;
|
||||
bool rconPortIsSet() const;
|
||||
void unsetRcon_port();
|
||||
void setRconPort(int32_t value);
|
||||
|
||||
int32_t getServerCount() const;
|
||||
bool serverCountIsSet() const;
|
||||
void unsetServer_count();
|
||||
void setServerCount(int32_t value);
|
||||
|
||||
int32_t getSteamAppId() const;
|
||||
bool steamAppIdIsSet() const;
|
||||
void unsetSteam_app_id();
|
||||
void setSteamAppId(int32_t value);
|
||||
|
||||
int32_t getSteamServerAppId() const;
|
||||
bool steamServerAppIdIsSet() const;
|
||||
void unsetSteam_server_app_id();
|
||||
void setSteamServerAppId(int32_t value);
|
||||
|
||||
bool isEnableServers() const;
|
||||
bool enableServersIsSet() const;
|
||||
void unsetEnable_servers();
|
||||
void setEnableServers(bool value);
|
||||
|
||||
utility::string_t getRustGamedigId() const;
|
||||
bool rustGamedigIdIsSet() const;
|
||||
void unsetRust_gamedig_id();
|
||||
void setRustGamedigId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getNodeGamedigId() const;
|
||||
bool nodeGamedigIdIsSet() const;
|
||||
void unsetNode_gamedig_id();
|
||||
void setNodeGamedigId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getServerConnectUrl() const;
|
||||
bool serverConnectUrlIsSet() const;
|
||||
void unsetServer_connect_url();
|
||||
void setServerConnectUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getServerTags() const;
|
||||
bool serverTagsIsSet() const;
|
||||
void unsetServer_tags();
|
||||
void setServerTags(const utility::string_t &value);
|
||||
|
||||
utility::string_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t &value);
|
||||
|
||||
std::shared_ptr<ApplicationType> getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(const std::shared_ptr<ApplicationType> &value);
|
||||
|
||||
utility::string_t getOrganizationId() const;
|
||||
bool organizationIdIsSet() const;
|
||||
void unsetOrganization_id();
|
||||
void setOrganizationId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getIconUrl() const;
|
||||
bool iconUrlIsSet() const;
|
||||
void unsetIcon_url();
|
||||
void setIconUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCapsuleImageUrl() const;
|
||||
bool capsuleImageUrlIsSet() const;
|
||||
void unsetCapsule_image_url();
|
||||
void setCapsuleImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getLibraryImageUrl() const;
|
||||
bool libraryImageUrlIsSet() const;
|
||||
void unsetLibrary_image_url();
|
||||
void setLibraryImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getParentId() const;
|
||||
bool parentIdIsSet() const;
|
||||
void unsetParent_id();
|
||||
void setParentId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getSlug() const;
|
||||
bool slugIsSet() const;
|
||||
void unsetSlug();
|
||||
void setSlug(const utility::string_t &value);
|
||||
|
||||
int32_t getVisibility() const;
|
||||
bool visibilityIsSet() const;
|
||||
void unsetVisibility();
|
||||
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;
|
||||
bool primaryIsSet() const;
|
||||
void unsetPrimary();
|
||||
void setPrimary(int32_t value);
|
||||
int32_t getUserCount() const;
|
||||
bool userCountIsSet() const;
|
||||
void unsetUser_count();
|
||||
void setUserCount(int32_t value);
|
||||
|
||||
int32_t getUserCount() const;
|
||||
bool userCountIsSet() const;
|
||||
void unsetUser_count();
|
||||
void setUserCount(int32_t value);
|
||||
int32_t getAchievementCount() const;
|
||||
bool achievementCountIsSet() const;
|
||||
void unsetAchievement_count();
|
||||
void setAchievementCount(int32_t value);
|
||||
|
||||
int32_t getAchievementCount() const;
|
||||
bool achievementCountIsSet() const;
|
||||
void unsetAchievement_count();
|
||||
void setAchievementCount(int32_t value);
|
||||
int32_t getBadgeCount() const;
|
||||
bool badgeCountIsSet() const;
|
||||
void unsetBadge_count();
|
||||
void setBadgeCount(int32_t value);
|
||||
|
||||
int32_t getBadgeCount() const;
|
||||
bool badgeCountIsSet() const;
|
||||
void unsetBadge_count();
|
||||
void setBadgeCount(int32_t value);
|
||||
int32_t getDownloadCount() const;
|
||||
bool downloadCountIsSet() const;
|
||||
void unsetDownload_count();
|
||||
void setDownloadCount(int32_t value);
|
||||
|
||||
int32_t getDownloadCount() const;
|
||||
bool downloadCountIsSet() const;
|
||||
void unsetDownload_count();
|
||||
void setDownloadCount(int32_t value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
int32_t m_Game_port;
|
||||
bool m_Game_portIsSet;
|
||||
|
||||
int32_t m_Query_port;
|
||||
bool m_Query_portIsSet;
|
||||
|
||||
protected:
|
||||
int32_t m_Game_port;
|
||||
bool m_Game_portIsSet;
|
||||
int32_t m_Rcon_port;
|
||||
bool m_Rcon_portIsSet;
|
||||
|
||||
int32_t m_Query_port;
|
||||
bool m_Query_portIsSet;
|
||||
int32_t m_Server_count;
|
||||
bool m_Server_countIsSet;
|
||||
|
||||
int32_t m_Rcon_port;
|
||||
bool m_Rcon_portIsSet;
|
||||
int32_t m_Steam_app_id;
|
||||
bool m_Steam_app_idIsSet;
|
||||
|
||||
int32_t m_Server_count;
|
||||
bool m_Server_countIsSet;
|
||||
int32_t m_Steam_server_app_id;
|
||||
bool m_Steam_server_app_idIsSet;
|
||||
|
||||
int32_t m_Steam_app_id;
|
||||
bool m_Steam_app_idIsSet;
|
||||
bool m_Enable_servers;
|
||||
bool m_Enable_serversIsSet;
|
||||
|
||||
int32_t m_Steam_server_app_id;
|
||||
bool m_Steam_server_app_idIsSet;
|
||||
utility::string_t m_Rust_gamedig_id;
|
||||
bool m_Rust_gamedig_idIsSet;
|
||||
|
||||
bool m_Enable_servers;
|
||||
bool m_Enable_serversIsSet;
|
||||
utility::string_t m_Node_gamedig_id;
|
||||
bool m_Node_gamedig_idIsSet;
|
||||
|
||||
utility::string_t m_Rust_gamedig_id;
|
||||
bool m_Rust_gamedig_idIsSet;
|
||||
utility::string_t m_Server_connect_url;
|
||||
bool m_Server_connect_urlIsSet;
|
||||
|
||||
utility::string_t m_Node_gamedig_id;
|
||||
bool m_Node_gamedig_idIsSet;
|
||||
utility::string_t m_Server_tags;
|
||||
bool m_Server_tagsIsSet;
|
||||
|
||||
utility::string_t m_Server_connect_url;
|
||||
bool m_Server_connect_urlIsSet;
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Server_tags;
|
||||
bool m_Server_tagsIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
std::shared_ptr<ApplicationType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
utility::string_t m_Organization_id;
|
||||
bool m_Organization_idIsSet;
|
||||
|
||||
std::shared_ptr<ApplicationType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
utility::string_t m_Icon_url;
|
||||
bool m_Icon_urlIsSet;
|
||||
|
||||
utility::string_t m_Organization_id;
|
||||
bool m_Organization_idIsSet;
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
|
||||
utility::string_t m_Icon_url;
|
||||
bool m_Icon_urlIsSet;
|
||||
utility::string_t m_Capsule_image_url;
|
||||
bool m_Capsule_image_urlIsSet;
|
||||
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
utility::string_t m_Library_image_url;
|
||||
bool m_Library_image_urlIsSet;
|
||||
|
||||
utility::string_t m_Capsule_image_url;
|
||||
bool m_Capsule_image_urlIsSet;
|
||||
utility::string_t m_Parent_id;
|
||||
bool m_Parent_idIsSet;
|
||||
|
||||
utility::string_t m_Library_image_url;
|
||||
bool m_Library_image_urlIsSet;
|
||||
utility::string_t m_Slug;
|
||||
bool m_SlugIsSet;
|
||||
|
||||
utility::string_t m_Parent_id;
|
||||
bool m_Parent_idIsSet;
|
||||
int32_t m_Visibility;
|
||||
bool m_VisibilityIsSet;
|
||||
|
||||
utility::string_t m_Slug;
|
||||
bool m_SlugIsSet;
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
|
||||
int32_t m_Visibility;
|
||||
bool m_VisibilityIsSet;
|
||||
int32_t m_Primary;
|
||||
bool m_PrimaryIsSet;
|
||||
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
int32_t m_User_count;
|
||||
bool m_User_countIsSet;
|
||||
|
||||
int32_t m_Primary;
|
||||
bool m_PrimaryIsSet;
|
||||
int32_t m_Achievement_count;
|
||||
bool m_Achievement_countIsSet;
|
||||
|
||||
int32_t m_User_count;
|
||||
bool m_User_countIsSet;
|
||||
int32_t m_Badge_count;
|
||||
bool m_Badge_countIsSet;
|
||||
|
||||
int32_t m_Achievement_count;
|
||||
bool m_Achievement_countIsSet;
|
||||
int32_t m_Download_count;
|
||||
bool m_Download_countIsSet;
|
||||
|
||||
int32_t m_Badge_count;
|
||||
bool m_Badge_countIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
int32_t m_Download_count;
|
||||
bool m_Download_countIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_Game_H_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* GameServer.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_GameServer_H_
|
||||
@ -23,291 +23,287 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/ServerStatus.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class GameServer
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
GameServer();
|
||||
virtual ~GameServer();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// GameServer members
|
||||
|
||||
|
||||
utility::string_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t& value);
|
||||
|
||||
utility::string_t getAddress() const;
|
||||
bool addressIsSet() const;
|
||||
void unsetAddress();
|
||||
void setAddress(const utility::string_t& value);
|
||||
|
||||
int32_t getGamePort() const;
|
||||
bool gamePortIsSet() const;
|
||||
void unsetGame_port();
|
||||
void setGamePort(int32_t value);
|
||||
|
||||
int32_t getQueryPort() const;
|
||||
bool queryPortIsSet() const;
|
||||
void unsetQuery_port();
|
||||
void setQueryPort(int32_t value);
|
||||
|
||||
utility::string_t getGameId() const;
|
||||
bool gameIdIsSet() const;
|
||||
void unsetGame_id();
|
||||
void setGameId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getGameIconUrl() const;
|
||||
bool gameIconUrlIsSet() const;
|
||||
void unsetGame_icon_url();
|
||||
void setGameIconUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getVersion() const;
|
||||
bool versionIsSet() const;
|
||||
void unsetVersion();
|
||||
void setVersion(const utility::string_t& value);
|
||||
|
||||
bool isFeatured() const;
|
||||
bool featuredIsSet() const;
|
||||
void unsetFeatured();
|
||||
void setFeatured(bool value);
|
||||
|
||||
utility::string_t getClusterId() const;
|
||||
bool clusterIdIsSet() const;
|
||||
void unsetCluster_id();
|
||||
void setClusterId(const utility::string_t& value);
|
||||
|
||||
utility::string_t getWebsiteUrl() const;
|
||||
bool websiteUrlIsSet() const;
|
||||
void unsetWebsite_url();
|
||||
void setWebsiteUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t& value);
|
||||
|
||||
utility::string_t getOwnerId() const;
|
||||
bool ownerIdIsSet() const;
|
||||
void unsetOwner_id();
|
||||
void setOwnerId(const utility::string_t& value);
|
||||
|
||||
double getUptime() const;
|
||||
bool uptimeIsSet() const;
|
||||
void unsetUptime();
|
||||
void setUptime(double value);
|
||||
|
||||
std::shared_ptr<ServerStatus> getStatus() const;
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
void setStatus(const std::shared_ptr<ServerStatus>& value);
|
||||
|
||||
int32_t getPing() const;
|
||||
bool pingIsSet() const;
|
||||
void unsetPing();
|
||||
void setPing(int32_t value);
|
||||
|
||||
utility::string_t getMap() const;
|
||||
bool mapIsSet() const;
|
||||
void unsetmap();
|
||||
void setMap(const utility::string_t& value);
|
||||
|
||||
int32_t getUsedSlots() const;
|
||||
bool usedSlotsIsSet() const;
|
||||
void unsetUsed_slots();
|
||||
void setUsedSlots(int32_t value);
|
||||
|
||||
int32_t getMaxSlots() const;
|
||||
bool maxSlotsIsSet() const;
|
||||
void unsetMax_slots();
|
||||
void setMaxSlots(int32_t value);
|
||||
|
||||
utility::string_t getMotd() const;
|
||||
bool motdIsSet() const;
|
||||
void unsetMotd();
|
||||
void setMotd(const utility::string_t& value);
|
||||
|
||||
utility::string_t getPlayers() const;
|
||||
bool playersIsSet() const;
|
||||
void unsetPlayers();
|
||||
void setPlayers(const utility::string_t& value);
|
||||
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
void setLastOnline(const utility::datetime& value);
|
||||
|
||||
utility::string_t getCountry() const;
|
||||
bool countryIsSet() const;
|
||||
void unsetCountry();
|
||||
void setCountry(const utility::string_t& value);
|
||||
namespace models
|
||||
{
|
||||
|
||||
class GameServer : public ModelBase
|
||||
{
|
||||
public:
|
||||
GameServer();
|
||||
virtual ~GameServer();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// GameServer members
|
||||
|
||||
utility::string_t getId() const;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t &value);
|
||||
|
||||
utility::string_t getAddress() const;
|
||||
bool addressIsSet() const;
|
||||
void unsetAddress();
|
||||
void setAddress(const utility::string_t &value);
|
||||
|
||||
int32_t getGamePort() const;
|
||||
bool gamePortIsSet() const;
|
||||
void unsetGame_port();
|
||||
void setGamePort(int32_t value);
|
||||
|
||||
int32_t getQueryPort() const;
|
||||
bool queryPortIsSet() const;
|
||||
void unsetQuery_port();
|
||||
void setQueryPort(int32_t value);
|
||||
|
||||
utility::string_t getGameId() const;
|
||||
bool gameIdIsSet() const;
|
||||
void unsetGame_id();
|
||||
void setGameId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getGameIconUrl() const;
|
||||
bool gameIconUrlIsSet() const;
|
||||
void unsetGame_icon_url();
|
||||
void setGameIconUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getVersion() const;
|
||||
bool versionIsSet() const;
|
||||
void unsetVersion();
|
||||
void setVersion(const utility::string_t &value);
|
||||
|
||||
bool isFeatured() const;
|
||||
bool featuredIsSet() const;
|
||||
void unsetFeatured();
|
||||
void setFeatured(bool value);
|
||||
|
||||
utility::string_t getClusterId() const;
|
||||
bool clusterIdIsSet() const;
|
||||
void unsetCluster_id();
|
||||
void setClusterId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getWebsiteUrl() const;
|
||||
bool websiteUrlIsSet() const;
|
||||
void unsetWebsite_url();
|
||||
void setWebsiteUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getOwnerId() const;
|
||||
bool ownerIdIsSet() const;
|
||||
void unsetOwner_id();
|
||||
void setOwnerId(const utility::string_t &value);
|
||||
|
||||
double getUptime() const;
|
||||
bool uptimeIsSet() const;
|
||||
void unsetUptime();
|
||||
void setUptime(double value);
|
||||
|
||||
std::shared_ptr<ServerStatus> getStatus() const;
|
||||
bool statusIsSet() const;
|
||||
void unsetStatus();
|
||||
void setStatus(const std::shared_ptr<ServerStatus> &value);
|
||||
|
||||
int32_t getPing() const;
|
||||
bool pingIsSet() const;
|
||||
void unsetPing();
|
||||
void setPing(int32_t value);
|
||||
|
||||
utility::string_t getMap() const;
|
||||
bool mapIsSet() const;
|
||||
void unsetmap();
|
||||
void setMap(const utility::string_t &value);
|
||||
|
||||
int32_t getUsedSlots() const;
|
||||
bool usedSlotsIsSet() const;
|
||||
void unsetUsed_slots();
|
||||
void setUsedSlots(int32_t value);
|
||||
|
||||
int32_t getMaxSlots() const;
|
||||
bool maxSlotsIsSet() const;
|
||||
void unsetMax_slots();
|
||||
void setMaxSlots(int32_t value);
|
||||
|
||||
utility::string_t getMotd() const;
|
||||
bool motdIsSet() const;
|
||||
void unsetMotd();
|
||||
void setMotd(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPlayers() const;
|
||||
bool playersIsSet() const;
|
||||
void unsetPlayers();
|
||||
void setPlayers(const utility::string_t &value);
|
||||
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
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;
|
||||
bool steamIsSet() const;
|
||||
void unsetSteam();
|
||||
void setSteam(bool value);
|
||||
utility::string_t getDiscordServerId() const;
|
||||
bool discordServerIdIsSet() const;
|
||||
void unsetDiscord_server_id();
|
||||
void setDiscordServerId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDiscordServerId() const;
|
||||
bool discordServerIdIsSet() const;
|
||||
void unsetDiscord_server_id();
|
||||
void setDiscordServerId(const utility::string_t& value);
|
||||
utility::string_t getYoutubeVideoUrl() const;
|
||||
bool youtubeVideoUrlIsSet() const;
|
||||
void unsetYoutube_video_url();
|
||||
void setYoutubeVideoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getYoutubeVideoUrl() const;
|
||||
bool youtubeVideoUrlIsSet() const;
|
||||
void unsetYoutube_video_url();
|
||||
void setYoutubeVideoUrl(const utility::string_t& value);
|
||||
utility::string_t getTags() const;
|
||||
bool tagsIsSet() const;
|
||||
void unsetTags();
|
||||
void setTags(const utility::string_t &value);
|
||||
|
||||
utility::string_t getTags() const;
|
||||
bool tagsIsSet() const;
|
||||
void unsetTags();
|
||||
void setTags(const utility::string_t& value);
|
||||
int32_t getCommentCount() const;
|
||||
bool commentCountIsSet() const;
|
||||
void unsetComment_count();
|
||||
void setCommentCount(int32_t value);
|
||||
|
||||
int32_t getCommentCount() const;
|
||||
bool commentCountIsSet() const;
|
||||
void unsetComment_count();
|
||||
void setCommentCount(int32_t value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Address;
|
||||
bool m_AddressIsSet;
|
||||
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
int32_t m_Game_port;
|
||||
bool m_Game_portIsSet;
|
||||
|
||||
utility::string_t m_Address;
|
||||
bool m_AddressIsSet;
|
||||
int32_t m_Query_port;
|
||||
bool m_Query_portIsSet;
|
||||
|
||||
int32_t m_Game_port;
|
||||
bool m_Game_portIsSet;
|
||||
utility::string_t m_Game_id;
|
||||
bool m_Game_idIsSet;
|
||||
|
||||
int32_t m_Query_port;
|
||||
bool m_Query_portIsSet;
|
||||
utility::string_t m_Game_icon_url;
|
||||
bool m_Game_icon_urlIsSet;
|
||||
|
||||
utility::string_t m_Game_id;
|
||||
bool m_Game_idIsSet;
|
||||
utility::string_t m_Version;
|
||||
bool m_VersionIsSet;
|
||||
|
||||
utility::string_t m_Game_icon_url;
|
||||
bool m_Game_icon_urlIsSet;
|
||||
bool m_Featured;
|
||||
bool m_FeaturedIsSet;
|
||||
|
||||
utility::string_t m_Version;
|
||||
bool m_VersionIsSet;
|
||||
utility::string_t m_Cluster_id;
|
||||
bool m_Cluster_idIsSet;
|
||||
|
||||
bool m_Featured;
|
||||
bool m_FeaturedIsSet;
|
||||
utility::string_t m_Website_url;
|
||||
bool m_Website_urlIsSet;
|
||||
|
||||
utility::string_t m_Cluster_id;
|
||||
bool m_Cluster_idIsSet;
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
|
||||
utility::string_t m_Website_url;
|
||||
bool m_Website_urlIsSet;
|
||||
utility::string_t m_Owner_id;
|
||||
bool m_Owner_idIsSet;
|
||||
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
double m_Uptime;
|
||||
bool m_UptimeIsSet;
|
||||
|
||||
utility::string_t m_Owner_id;
|
||||
bool m_Owner_idIsSet;
|
||||
std::shared_ptr<ServerStatus> m_Status;
|
||||
bool m_StatusIsSet;
|
||||
|
||||
double m_Uptime;
|
||||
bool m_UptimeIsSet;
|
||||
int32_t m_Ping;
|
||||
bool m_PingIsSet;
|
||||
|
||||
std::shared_ptr<ServerStatus> m_Status;
|
||||
bool m_StatusIsSet;
|
||||
utility::string_t m_map;
|
||||
bool m_mapIsSet;
|
||||
|
||||
int32_t m_Ping;
|
||||
bool m_PingIsSet;
|
||||
int32_t m_Used_slots;
|
||||
bool m_Used_slotsIsSet;
|
||||
|
||||
utility::string_t m_map;
|
||||
bool m_mapIsSet;
|
||||
int32_t m_Max_slots;
|
||||
bool m_Max_slotsIsSet;
|
||||
|
||||
int32_t m_Used_slots;
|
||||
bool m_Used_slotsIsSet;
|
||||
utility::string_t m_Motd;
|
||||
bool m_MotdIsSet;
|
||||
|
||||
int32_t m_Max_slots;
|
||||
bool m_Max_slotsIsSet;
|
||||
utility::string_t m_Players;
|
||||
bool m_PlayersIsSet;
|
||||
|
||||
utility::string_t m_Motd;
|
||||
bool m_MotdIsSet;
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
|
||||
utility::string_t m_Players;
|
||||
bool m_PlayersIsSet;
|
||||
utility::string_t m_Country;
|
||||
bool m_CountryIsSet;
|
||||
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
bool m_Steam;
|
||||
bool m_SteamIsSet;
|
||||
|
||||
utility::string_t m_Country;
|
||||
bool m_CountryIsSet;
|
||||
utility::string_t m_Discord_server_id;
|
||||
bool m_Discord_server_idIsSet;
|
||||
|
||||
bool m_Steam;
|
||||
bool m_SteamIsSet;
|
||||
utility::string_t m_Youtube_video_url;
|
||||
bool m_Youtube_video_urlIsSet;
|
||||
|
||||
utility::string_t m_Discord_server_id;
|
||||
bool m_Discord_server_idIsSet;
|
||||
utility::string_t m_Tags;
|
||||
bool m_TagsIsSet;
|
||||
|
||||
utility::string_t m_Youtube_video_url;
|
||||
bool m_Youtube_video_urlIsSet;
|
||||
int32_t m_Comment_count;
|
||||
bool m_Comment_countIsSet;
|
||||
|
||||
utility::string_t m_Tags;
|
||||
bool m_TagsIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
int32_t m_Comment_count;
|
||||
bool m_Comment_countIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_GameServer_H_ */
|
||||
|
@ -13,163 +13,158 @@
|
||||
/*
|
||||
* GameServerCluster.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_GameServerCluster_H_
|
||||
#define TRIBUFU_MODELS_GameServerCluster_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class GameServerCluster
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
GameServerCluster();
|
||||
virtual ~GameServerCluster();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class GameServerCluster : public ModelBase
|
||||
{
|
||||
public:
|
||||
GameServerCluster();
|
||||
virtual ~GameServerCluster();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t& value);
|
||||
utility::string_t getGameId() const;
|
||||
bool gameIdIsSet() const;
|
||||
void unsetGame_id();
|
||||
void setGameId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getGameId() const;
|
||||
bool gameIdIsSet() const;
|
||||
void unsetGame_id();
|
||||
void setGameId(const utility::string_t& value);
|
||||
utility::string_t getWebsiteUrl() const;
|
||||
bool websiteUrlIsSet() const;
|
||||
void unsetWebsite_url();
|
||||
void setWebsiteUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getWebsiteUrl() const;
|
||||
bool websiteUrlIsSet() const;
|
||||
void unsetWebsite_url();
|
||||
void setWebsiteUrl(const utility::string_t& value);
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t& value);
|
||||
utility::string_t getOwnerId() const;
|
||||
bool ownerIdIsSet() const;
|
||||
void unsetOwner_id();
|
||||
void setOwnerId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getOwnerId() const;
|
||||
bool ownerIdIsSet() const;
|
||||
void unsetOwner_id();
|
||||
void setOwnerId(const utility::string_t& value);
|
||||
utility::string_t getDiscordServerId() const;
|
||||
bool discordServerIdIsSet() const;
|
||||
void unsetDiscord_server_id();
|
||||
void setDiscordServerId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDiscordServerId() const;
|
||||
bool discordServerIdIsSet() const;
|
||||
void unsetDiscord_server_id();
|
||||
void setDiscordServerId(const utility::string_t& value);
|
||||
utility::string_t getYoutubeVideoUrl() const;
|
||||
bool youtubeVideoUrlIsSet() const;
|
||||
void unsetYoutube_video_url();
|
||||
void setYoutubeVideoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getYoutubeVideoUrl() const;
|
||||
bool youtubeVideoUrlIsSet() const;
|
||||
void unsetYoutube_video_url();
|
||||
void setYoutubeVideoUrl(const utility::string_t& value);
|
||||
utility::string_t getTags() const;
|
||||
bool tagsIsSet() const;
|
||||
void unsetTags();
|
||||
void setTags(const utility::string_t &value);
|
||||
|
||||
utility::string_t getTags() const;
|
||||
bool tagsIsSet() const;
|
||||
void unsetTags();
|
||||
void setTags(const utility::string_t& value);
|
||||
int32_t getCommentCount() const;
|
||||
bool commentCountIsSet() const;
|
||||
void unsetComment_count();
|
||||
void setCommentCount(int32_t value);
|
||||
|
||||
int32_t getCommentCount() const;
|
||||
bool commentCountIsSet() const;
|
||||
void unsetComment_count();
|
||||
void setCommentCount(int32_t value);
|
||||
int32_t getServerCount() const;
|
||||
bool serverCountIsSet() const;
|
||||
void unsetServer_count();
|
||||
void setServerCount(int32_t value);
|
||||
|
||||
int32_t getServerCount() const;
|
||||
bool serverCountIsSet() const;
|
||||
void unsetServer_count();
|
||||
void setServerCount(int32_t value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Game_id;
|
||||
bool m_Game_idIsSet;
|
||||
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
utility::string_t m_Website_url;
|
||||
bool m_Website_urlIsSet;
|
||||
|
||||
utility::string_t m_Game_id;
|
||||
bool m_Game_idIsSet;
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
|
||||
utility::string_t m_Website_url;
|
||||
bool m_Website_urlIsSet;
|
||||
utility::string_t m_Owner_id;
|
||||
bool m_Owner_idIsSet;
|
||||
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
utility::string_t m_Discord_server_id;
|
||||
bool m_Discord_server_idIsSet;
|
||||
|
||||
utility::string_t m_Owner_id;
|
||||
bool m_Owner_idIsSet;
|
||||
utility::string_t m_Youtube_video_url;
|
||||
bool m_Youtube_video_urlIsSet;
|
||||
|
||||
utility::string_t m_Discord_server_id;
|
||||
bool m_Discord_server_idIsSet;
|
||||
utility::string_t m_Tags;
|
||||
bool m_TagsIsSet;
|
||||
|
||||
utility::string_t m_Youtube_video_url;
|
||||
bool m_Youtube_video_urlIsSet;
|
||||
int32_t m_Comment_count;
|
||||
bool m_Comment_countIsSet;
|
||||
|
||||
utility::string_t m_Tags;
|
||||
bool m_TagsIsSet;
|
||||
int32_t m_Server_count;
|
||||
bool m_Server_countIsSet;
|
||||
|
||||
int32_t m_Comment_count;
|
||||
bool m_Comment_countIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
int32_t m_Server_count;
|
||||
bool m_Server_countIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_GameServerCluster_H_ */
|
||||
|
@ -13,54 +13,54 @@
|
||||
/*
|
||||
* GrantType.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_GrantType_H_
|
||||
#define TRIBUFU_MODELS_GrantType_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class GrantType
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
GrantType_AUTHORIZATION_CODE,
|
||||
GrantType_CLIENT_CREDENTIALS,
|
||||
GrantType_PASSWORD,
|
||||
GrantType_REFRESH_TOKEN,
|
||||
};
|
||||
|
||||
eGrantType getValue() const;
|
||||
void setValue(eGrantType const value);
|
||||
class GrantType : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,179 +13,174 @@
|
||||
/*
|
||||
* Group.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_Group_H_
|
||||
#define TRIBUFU_MODELS_Group_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class Group
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Group();
|
||||
virtual ~Group();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class Group : public ModelBase
|
||||
{
|
||||
public:
|
||||
Group();
|
||||
virtual ~Group();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t &value);
|
||||
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getTag() const;
|
||||
bool tagIsSet() const;
|
||||
void unsetTag();
|
||||
void setTag(const utility::string_t &value);
|
||||
|
||||
utility::string_t getTag() const;
|
||||
bool tagIsSet() const;
|
||||
void unsetTag();
|
||||
void setTag(const utility::string_t& value);
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t& value);
|
||||
int32_t getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(int32_t value);
|
||||
|
||||
int32_t getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(int32_t value);
|
||||
int32_t getPrivacy() const;
|
||||
bool privacyIsSet() const;
|
||||
void unsetPrivacy();
|
||||
void setPrivacy(int32_t value);
|
||||
|
||||
int32_t getPrivacy() const;
|
||||
bool privacyIsSet() const;
|
||||
void unsetPrivacy();
|
||||
void setPrivacy(int32_t value);
|
||||
utility::string_t getOwnerId() const;
|
||||
bool ownerIdIsSet() const;
|
||||
void unsetOwner_id();
|
||||
void setOwnerId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getOwnerId() const;
|
||||
bool ownerIdIsSet() const;
|
||||
void unsetOwner_id();
|
||||
void setOwnerId(const utility::string_t& value);
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t& value);
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t& value);
|
||||
int32_t getMemberCount() const;
|
||||
bool memberCountIsSet() const;
|
||||
void unsetMember_count();
|
||||
void setMemberCount(int32_t value);
|
||||
|
||||
int32_t getMemberCount() const;
|
||||
bool memberCountIsSet() const;
|
||||
void unsetMember_count();
|
||||
void setMemberCount(int32_t value);
|
||||
int32_t getFollowerCount() const;
|
||||
bool followerCountIsSet() const;
|
||||
void unsetFollower_count();
|
||||
void setFollowerCount(int32_t value);
|
||||
|
||||
int32_t getFollowerCount() const;
|
||||
bool followerCountIsSet() const;
|
||||
void unsetFollower_count();
|
||||
void setFollowerCount(int32_t value);
|
||||
int32_t getViewCount() const;
|
||||
bool viewCountIsSet() const;
|
||||
void unsetView_count();
|
||||
void setViewCount(int32_t value);
|
||||
|
||||
int32_t getViewCount() const;
|
||||
bool viewCountIsSet() const;
|
||||
void unsetView_count();
|
||||
void setViewCount(int32_t value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
utility::string_t m_Tag;
|
||||
bool m_TagIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
|
||||
utility::string_t m_Tag;
|
||||
bool m_TagIsSet;
|
||||
int32_t m_Type;
|
||||
bool m_TypeIsSet;
|
||||
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
int32_t m_Privacy;
|
||||
bool m_PrivacyIsSet;
|
||||
|
||||
int32_t m_Type;
|
||||
bool m_TypeIsSet;
|
||||
utility::string_t m_Owner_id;
|
||||
bool m_Owner_idIsSet;
|
||||
|
||||
int32_t m_Privacy;
|
||||
bool m_PrivacyIsSet;
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
|
||||
utility::string_t m_Owner_id;
|
||||
bool m_Owner_idIsSet;
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
int32_t m_Member_count;
|
||||
bool m_Member_countIsSet;
|
||||
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
int32_t m_Follower_count;
|
||||
bool m_Follower_countIsSet;
|
||||
|
||||
int32_t m_Member_count;
|
||||
bool m_Member_countIsSet;
|
||||
int32_t m_View_count;
|
||||
bool m_View_countIsSet;
|
||||
|
||||
int32_t m_Follower_count;
|
||||
bool m_Follower_countIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
int32_t m_View_count;
|
||||
bool m_View_countIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_Group_H_ */
|
||||
|
@ -13,112 +13,108 @@
|
||||
/*
|
||||
* GroupGame.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_GroupGame_H_
|
||||
#define TRIBUFU_MODELS_GroupGame_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++/model/Application.h"
|
||||
#include "tribufu++/model/Group.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class Group;
|
||||
class Application;
|
||||
|
||||
|
||||
class GroupGame
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
GroupGame();
|
||||
virtual ~GroupGame();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class Group;
|
||||
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;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value &json) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// GroupGame members
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// GroupGame members
|
||||
|
||||
utility::string_t getGroupId() const;
|
||||
bool groupIdIsSet() const;
|
||||
void unsetGroup_id();
|
||||
void setGroupId(const utility::string_t& value);
|
||||
utility::string_t getGroupId() const;
|
||||
bool groupIdIsSet() const;
|
||||
void unsetGroup_id();
|
||||
void setGroupId(const utility::string_t &value);
|
||||
|
||||
std::shared_ptr<Group> getGroup() const;
|
||||
bool groupIsSet() const;
|
||||
void unsetGroup();
|
||||
void setGroup(const std::shared_ptr<Group>& value);
|
||||
std::shared_ptr<Group> getGroup() const;
|
||||
bool groupIsSet() const;
|
||||
void unsetGroup();
|
||||
void setGroup(const std::shared_ptr<Group> &value);
|
||||
|
||||
utility::string_t getApplicationId() const;
|
||||
bool applicationIdIsSet() const;
|
||||
void unsetApplication_id();
|
||||
void setApplicationId(const utility::string_t& value);
|
||||
utility::string_t getApplicationId() const;
|
||||
bool applicationIdIsSet() const;
|
||||
void unsetApplication_id();
|
||||
void setApplicationId(const utility::string_t &value);
|
||||
|
||||
std::shared_ptr<Application> getApplication() const;
|
||||
bool applicationIsSet() const;
|
||||
void unsetApplication();
|
||||
void setApplication(const std::shared_ptr<Application>& value);
|
||||
std::shared_ptr<Application> getApplication() const;
|
||||
bool applicationIsSet() const;
|
||||
void unsetApplication();
|
||||
void setApplication(const std::shared_ptr<Application> &value);
|
||||
|
||||
std::shared_ptr<AnyType> getStats() const;
|
||||
bool statsIsSet() const;
|
||||
void unsetStats();
|
||||
void setStats(const std::shared_ptr<AnyType>& value);
|
||||
std::shared_ptr<AnyType> getStats() const;
|
||||
bool statsIsSet() const;
|
||||
void unsetStats();
|
||||
void setStats(const std::shared_ptr<AnyType> &value);
|
||||
|
||||
utility::datetime getAcquired() const;
|
||||
bool acquiredIsSet() const;
|
||||
void unsetAcquired();
|
||||
void setAcquired(const utility::datetime& value);
|
||||
utility::datetime getAcquired() const;
|
||||
bool acquiredIsSet() const;
|
||||
void unsetAcquired();
|
||||
void setAcquired(const utility::datetime &value);
|
||||
|
||||
utility::datetime getLastUsed() const;
|
||||
bool lastUsedIsSet() const;
|
||||
void unsetLast_used();
|
||||
void setLastUsed(const utility::datetime& value);
|
||||
utility::datetime getLastUsed() const;
|
||||
bool lastUsedIsSet() const;
|
||||
void unsetLast_used();
|
||||
void setLastUsed(const utility::datetime &value);
|
||||
|
||||
protected:
|
||||
utility::string_t m_Group_id;
|
||||
bool m_Group_idIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Group_id;
|
||||
bool m_Group_idIsSet;
|
||||
std::shared_ptr<Group> m_Group;
|
||||
bool m_GroupIsSet;
|
||||
|
||||
std::shared_ptr<Group> m_Group;
|
||||
bool m_GroupIsSet;
|
||||
utility::string_t m_Application_id;
|
||||
bool m_Application_idIsSet;
|
||||
|
||||
utility::string_t m_Application_id;
|
||||
bool m_Application_idIsSet;
|
||||
std::shared_ptr<Application> m_Application;
|
||||
bool m_ApplicationIsSet;
|
||||
|
||||
std::shared_ptr<Application> m_Application;
|
||||
bool m_ApplicationIsSet;
|
||||
std::shared_ptr<AnyType> m_Stats;
|
||||
bool m_StatsIsSet;
|
||||
|
||||
std::shared_ptr<AnyType> m_Stats;
|
||||
bool m_StatsIsSet;
|
||||
utility::datetime m_Acquired;
|
||||
bool m_AcquiredIsSet;
|
||||
|
||||
utility::datetime m_Acquired;
|
||||
bool m_AcquiredIsSet;
|
||||
utility::datetime m_Last_used;
|
||||
bool m_Last_usedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Last_used;
|
||||
bool m_Last_usedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_GroupGame_H_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* GroupMember.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_GroupMember_H_
|
||||
@ -23,115 +23,111 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/GroupRank.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class GroupMember
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
GroupMember();
|
||||
virtual ~GroupMember();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class GroupMember : public ModelBase
|
||||
{
|
||||
public:
|
||||
GroupMember();
|
||||
virtual ~GroupMember();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t &value);
|
||||
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t& value);
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t& value);
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
void setLastOnline(const utility::datetime &value);
|
||||
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
void setLastOnline(const utility::datetime& value);
|
||||
std::shared_ptr<GroupRank> getRank() const;
|
||||
bool rankIsSet() const;
|
||||
void unsetRank();
|
||||
void setRank(const std::shared_ptr<GroupRank> &value);
|
||||
|
||||
std::shared_ptr<GroupRank> getRank() const;
|
||||
bool rankIsSet() const;
|
||||
void unsetRank();
|
||||
void setRank(const std::shared_ptr<GroupRank>& value);
|
||||
utility::datetime getSince() const;
|
||||
bool sinceIsSet() const;
|
||||
void unsetSince();
|
||||
void setSince(const utility::datetime &value);
|
||||
|
||||
utility::datetime getSince() const;
|
||||
bool sinceIsSet() const;
|
||||
void unsetSince();
|
||||
void setSince(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
std::shared_ptr<GroupRank> m_Rank;
|
||||
bool m_RankIsSet;
|
||||
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
utility::datetime m_Since;
|
||||
bool m_SinceIsSet;
|
||||
};
|
||||
|
||||
std::shared_ptr<GroupRank> m_Rank;
|
||||
bool m_RankIsSet;
|
||||
|
||||
utility::datetime m_Since;
|
||||
bool m_SinceIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_GroupMember_H_ */
|
||||
|
@ -13,53 +13,53 @@
|
||||
/*
|
||||
* GroupRank.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_GroupRank_H_
|
||||
#define TRIBUFU_MODELS_GroupRank_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class GroupRank
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
GroupRank_MEMBER,
|
||||
GroupRank_LEADER,
|
||||
GroupRank_OWNER,
|
||||
};
|
||||
|
||||
eGroupRank getValue() const;
|
||||
void setValue(eGroupRank const value);
|
||||
class GroupRank : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,59 +13,54 @@
|
||||
/*
|
||||
* HashViewModel.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_HashViewModel_H_
|
||||
#define TRIBUFU_MODELS_HashViewModel_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class HashViewModel
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
HashViewModel();
|
||||
virtual ~HashViewModel();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class HashViewModel : public ModelBase
|
||||
{
|
||||
public:
|
||||
HashViewModel();
|
||||
virtual ~HashViewModel();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool valueIsSet() const;
|
||||
void unsetValue();
|
||||
void setValue(const utility::string_t& value);
|
||||
protected:
|
||||
utility::string_t m_Value;
|
||||
bool m_ValueIsSet;
|
||||
};
|
||||
|
||||
|
||||
protected:
|
||||
utility::string_t m_Value;
|
||||
bool m_ValueIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_HashViewModel_H_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* IntrospectRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_IntrospectRequest_H_
|
||||
@ -23,59 +23,55 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/TokenHintType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class IntrospectRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
IntrospectRequest();
|
||||
virtual ~IntrospectRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class IntrospectRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
IntrospectRequest();
|
||||
virtual ~IntrospectRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool tokenIsSet() const;
|
||||
void unsetToken();
|
||||
void setToken(const utility::string_t& value);
|
||||
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
||||
bool tokenTypeHintIsSet() const;
|
||||
void unsetToken_type_hint();
|
||||
void setTokenTypeHint(const std::shared_ptr<TokenHintType> &value);
|
||||
|
||||
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
||||
bool tokenTypeHintIsSet() const;
|
||||
void unsetToken_type_hint();
|
||||
void setTokenTypeHint(const std::shared_ptr<TokenHintType>& value);
|
||||
protected:
|
||||
utility::string_t m_Token;
|
||||
bool m_TokenIsSet;
|
||||
|
||||
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_ */
|
||||
|
@ -13,195 +13,190 @@
|
||||
/*
|
||||
* IpAddress.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_IpAddress_H_
|
||||
#define TRIBUFU_MODELS_IpAddress_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class IpAddress
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
IpAddress();
|
||||
virtual ~IpAddress();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class IpAddress : public ModelBase
|
||||
{
|
||||
public:
|
||||
IpAddress();
|
||||
virtual ~IpAddress();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool addressIsSet() const;
|
||||
void unsetAddress();
|
||||
void setAddress(const utility::string_t& value);
|
||||
int32_t getVersion() const;
|
||||
bool versionIsSet() const;
|
||||
void unsetVersion();
|
||||
void setVersion(int32_t value);
|
||||
|
||||
int32_t getVersion() const;
|
||||
bool versionIsSet() const;
|
||||
void unsetVersion();
|
||||
void setVersion(int32_t value);
|
||||
utility::string_t getNetwork() const;
|
||||
bool networkIsSet() const;
|
||||
void unsetNetwork();
|
||||
void setNetwork(const utility::string_t &value);
|
||||
|
||||
utility::string_t getNetwork() const;
|
||||
bool networkIsSet() const;
|
||||
void unsetNetwork();
|
||||
void setNetwork(const utility::string_t& value);
|
||||
bool isReserved() const;
|
||||
bool reservedIsSet() const;
|
||||
void unsetReserved();
|
||||
void setReserved(bool value);
|
||||
|
||||
bool isReserved() const;
|
||||
bool reservedIsSet() const;
|
||||
void unsetReserved();
|
||||
void setReserved(bool value);
|
||||
utility::string_t getAsn() const;
|
||||
bool asnIsSet() const;
|
||||
void unsetAsn();
|
||||
void setAsn(const utility::string_t &value);
|
||||
|
||||
utility::string_t getAsn() const;
|
||||
bool asnIsSet() const;
|
||||
void unsetAsn();
|
||||
void setAsn(const utility::string_t& value);
|
||||
utility::string_t getIsp() const;
|
||||
bool ispIsSet() const;
|
||||
void unsetIsp();
|
||||
void setIsp(const utility::string_t &value);
|
||||
|
||||
utility::string_t getIsp() const;
|
||||
bool ispIsSet() const;
|
||||
void unsetIsp();
|
||||
void setIsp(const utility::string_t& value);
|
||||
utility::string_t getContinent() const;
|
||||
bool continentIsSet() const;
|
||||
void unsetContinent();
|
||||
void setContinent(const utility::string_t &value);
|
||||
|
||||
utility::string_t getContinent() const;
|
||||
bool continentIsSet() const;
|
||||
void unsetContinent();
|
||||
void setContinent(const utility::string_t& value);
|
||||
utility::string_t getCountry() const;
|
||||
bool countryIsSet() const;
|
||||
void unsetCountry();
|
||||
void setCountry(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCountry() const;
|
||||
bool countryIsSet() const;
|
||||
void unsetCountry();
|
||||
void setCountry(const utility::string_t& value);
|
||||
utility::string_t getRegion() const;
|
||||
bool regionIsSet() const;
|
||||
void unsetRegion();
|
||||
void setRegion(const utility::string_t &value);
|
||||
|
||||
utility::string_t getRegion() const;
|
||||
bool regionIsSet() const;
|
||||
void unsetRegion();
|
||||
void setRegion(const utility::string_t& value);
|
||||
utility::string_t getCity() const;
|
||||
bool cityIsSet() const;
|
||||
void unsetCity();
|
||||
void setCity(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCity() const;
|
||||
bool cityIsSet() const;
|
||||
void unsetCity();
|
||||
void setCity(const utility::string_t& value);
|
||||
utility::string_t getPostalCode() const;
|
||||
bool postalCodeIsSet() const;
|
||||
void unsetPostal_code();
|
||||
void setPostalCode(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPostalCode() const;
|
||||
bool postalCodeIsSet() const;
|
||||
void unsetPostal_code();
|
||||
void setPostalCode(const utility::string_t& value);
|
||||
utility::string_t getCallingCode() const;
|
||||
bool callingCodeIsSet() const;
|
||||
void unsetCalling_code();
|
||||
void setCallingCode(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCallingCode() const;
|
||||
bool callingCodeIsSet() const;
|
||||
void unsetCalling_code();
|
||||
void setCallingCode(const utility::string_t& value);
|
||||
utility::string_t getTld() const;
|
||||
bool tldIsSet() const;
|
||||
void unsetTld();
|
||||
void setTld(const utility::string_t &value);
|
||||
|
||||
utility::string_t getTld() const;
|
||||
bool tldIsSet() const;
|
||||
void unsetTld();
|
||||
void setTld(const utility::string_t& value);
|
||||
utility::string_t getLanguage() const;
|
||||
bool languageIsSet() const;
|
||||
void unsetLanguage();
|
||||
void setLanguage(const utility::string_t &value);
|
||||
|
||||
utility::string_t getLanguage() const;
|
||||
bool languageIsSet() const;
|
||||
void unsetLanguage();
|
||||
void setLanguage(const utility::string_t& value);
|
||||
utility::string_t getTimezone() const;
|
||||
bool timezoneIsSet() const;
|
||||
void unsetTimezone();
|
||||
void setTimezone(const utility::string_t &value);
|
||||
|
||||
utility::string_t getTimezone() const;
|
||||
bool timezoneIsSet() const;
|
||||
void unsetTimezone();
|
||||
void setTimezone(const utility::string_t& value);
|
||||
utility::string_t getCurrency() const;
|
||||
bool currencyIsSet() const;
|
||||
void unsetCurrency();
|
||||
void setCurrency(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCurrency() const;
|
||||
bool currencyIsSet() const;
|
||||
void unsetCurrency();
|
||||
void setCurrency(const utility::string_t& value);
|
||||
float getLatitude() const;
|
||||
bool latitudeIsSet() const;
|
||||
void unsetLatitude();
|
||||
void setLatitude(float value);
|
||||
|
||||
float getLatitude() const;
|
||||
bool latitudeIsSet() const;
|
||||
void unsetLatitude();
|
||||
void setLatitude(float value);
|
||||
float getLongitude() const;
|
||||
bool longitudeIsSet() const;
|
||||
void unsetLongitude();
|
||||
void setLongitude(float value);
|
||||
|
||||
float getLongitude() const;
|
||||
bool longitudeIsSet() const;
|
||||
void unsetLongitude();
|
||||
void setLongitude(float value);
|
||||
protected:
|
||||
utility::string_t m_Address;
|
||||
bool m_AddressIsSet;
|
||||
|
||||
int32_t m_Version;
|
||||
bool m_VersionIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Address;
|
||||
bool m_AddressIsSet;
|
||||
utility::string_t m_Network;
|
||||
bool m_NetworkIsSet;
|
||||
|
||||
int32_t m_Version;
|
||||
bool m_VersionIsSet;
|
||||
bool m_Reserved;
|
||||
bool m_ReservedIsSet;
|
||||
|
||||
utility::string_t m_Network;
|
||||
bool m_NetworkIsSet;
|
||||
utility::string_t m_Asn;
|
||||
bool m_AsnIsSet;
|
||||
|
||||
bool m_Reserved;
|
||||
bool m_ReservedIsSet;
|
||||
utility::string_t m_Isp;
|
||||
bool m_IspIsSet;
|
||||
|
||||
utility::string_t m_Asn;
|
||||
bool m_AsnIsSet;
|
||||
utility::string_t m_Continent;
|
||||
bool m_ContinentIsSet;
|
||||
|
||||
utility::string_t m_Isp;
|
||||
bool m_IspIsSet;
|
||||
utility::string_t m_Country;
|
||||
bool m_CountryIsSet;
|
||||
|
||||
utility::string_t m_Continent;
|
||||
bool m_ContinentIsSet;
|
||||
utility::string_t m_Region;
|
||||
bool m_RegionIsSet;
|
||||
|
||||
utility::string_t m_Country;
|
||||
bool m_CountryIsSet;
|
||||
utility::string_t m_City;
|
||||
bool m_CityIsSet;
|
||||
|
||||
utility::string_t m_Region;
|
||||
bool m_RegionIsSet;
|
||||
utility::string_t m_Postal_code;
|
||||
bool m_Postal_codeIsSet;
|
||||
|
||||
utility::string_t m_City;
|
||||
bool m_CityIsSet;
|
||||
utility::string_t m_Calling_code;
|
||||
bool m_Calling_codeIsSet;
|
||||
|
||||
utility::string_t m_Postal_code;
|
||||
bool m_Postal_codeIsSet;
|
||||
utility::string_t m_Tld;
|
||||
bool m_TldIsSet;
|
||||
|
||||
utility::string_t m_Calling_code;
|
||||
bool m_Calling_codeIsSet;
|
||||
utility::string_t m_Language;
|
||||
bool m_LanguageIsSet;
|
||||
|
||||
utility::string_t m_Tld;
|
||||
bool m_TldIsSet;
|
||||
utility::string_t m_Timezone;
|
||||
bool m_TimezoneIsSet;
|
||||
|
||||
utility::string_t m_Language;
|
||||
bool m_LanguageIsSet;
|
||||
utility::string_t m_Currency;
|
||||
bool m_CurrencyIsSet;
|
||||
|
||||
utility::string_t m_Timezone;
|
||||
bool m_TimezoneIsSet;
|
||||
float m_Latitude;
|
||||
bool m_LatitudeIsSet;
|
||||
|
||||
utility::string_t m_Currency;
|
||||
bool m_CurrencyIsSet;
|
||||
float m_Longitude;
|
||||
bool m_LongitudeIsSet;
|
||||
};
|
||||
|
||||
float m_Latitude;
|
||||
bool m_LatitudeIsSet;
|
||||
|
||||
float m_Longitude;
|
||||
bool m_LongitudeIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_IpAddress_H_ */
|
||||
|
@ -13,99 +13,94 @@
|
||||
/*
|
||||
* LeaderboardItem.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_LeaderboardItem_H_
|
||||
#define TRIBUFU_MODELS_LeaderboardItem_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class LeaderboardItem
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
LeaderboardItem();
|
||||
virtual ~LeaderboardItem();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class LeaderboardItem : public ModelBase
|
||||
{
|
||||
public:
|
||||
LeaderboardItem();
|
||||
virtual ~LeaderboardItem();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t& value);
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t& value);
|
||||
int32_t getLevel() const;
|
||||
bool levelIsSet() const;
|
||||
void unsetLevel();
|
||||
void setLevel(int32_t value);
|
||||
|
||||
int32_t getLevel() const;
|
||||
bool levelIsSet() const;
|
||||
void unsetLevel();
|
||||
void setLevel(int32_t value);
|
||||
double getExperience() const;
|
||||
bool experienceIsSet() const;
|
||||
void unsetExperience();
|
||||
void setExperience(double value);
|
||||
|
||||
double getExperience() const;
|
||||
bool experienceIsSet() const;
|
||||
void unsetExperience();
|
||||
void setExperience(double value);
|
||||
double getPoints() const;
|
||||
bool pointsIsSet() const;
|
||||
void unsetPoints();
|
||||
void setPoints(double value);
|
||||
|
||||
double getPoints() const;
|
||||
bool pointsIsSet() const;
|
||||
void unsetPoints();
|
||||
void setPoints(double value);
|
||||
protected:
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
int32_t m_Level;
|
||||
bool m_LevelIsSet;
|
||||
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
double m_Experience;
|
||||
bool m_ExperienceIsSet;
|
||||
|
||||
int32_t m_Level;
|
||||
bool m_LevelIsSet;
|
||||
double m_Points;
|
||||
bool m_PointsIsSet;
|
||||
};
|
||||
|
||||
double m_Experience;
|
||||
bool m_ExperienceIsSet;
|
||||
|
||||
double m_Points;
|
||||
bool m_PointsIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_LeaderboardItem_H_ */
|
||||
|
@ -13,52 +13,52 @@
|
||||
/*
|
||||
* LeaderboardOrder.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_LeaderboardOrder_H_
|
||||
#define TRIBUFU_MODELS_LeaderboardOrder_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class LeaderboardOrder
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
LeaderboardOrder_LEVEL,
|
||||
LeaderboardOrder_POINTS,
|
||||
};
|
||||
|
||||
eLeaderboardOrder getValue() const;
|
||||
void setValue(eLeaderboardOrder const value);
|
||||
class LeaderboardOrder : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,57 +13,57 @@
|
||||
/*
|
||||
* LoginProvider.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_LoginProvider_H_
|
||||
#define TRIBUFU_MODELS_LoginProvider_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class LoginProvider
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
LoginProvider_STEAM,
|
||||
LoginProvider_EPIC,
|
||||
LoginProvider_DISCORD,
|
||||
LoginProvider_MICROSOFT,
|
||||
LoginProvider_PLAYSTATION,
|
||||
LoginProvider_GOOGLE,
|
||||
LoginProvider_APPLE,
|
||||
};
|
||||
|
||||
eLoginProvider getValue() const;
|
||||
void setValue(eLoginProvider const value);
|
||||
class LoginProvider : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,67 +13,62 @@
|
||||
/*
|
||||
* LoginRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_LoginRequest_H_
|
||||
#define TRIBUFU_MODELS_LoginRequest_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class LoginRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
LoginRequest();
|
||||
virtual ~LoginRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class LoginRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
LoginRequest();
|
||||
virtual ~LoginRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool loginIsSet() const;
|
||||
void unsetLogin();
|
||||
void setLogin(const utility::string_t& value);
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_t& value);
|
||||
protected:
|
||||
utility::string_t m_Login;
|
||||
bool m_LoginIsSet;
|
||||
|
||||
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_ */
|
||||
|
@ -13,85 +13,81 @@
|
||||
/*
|
||||
* LoginResponse.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_LoginResponse_H_
|
||||
#define TRIBUFU_MODELS_LoginResponse_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include "tribufu++/model/UserInfo.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
class UserInfo;
|
||||
|
||||
|
||||
class LoginResponse
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
LoginResponse();
|
||||
virtual ~LoginResponse();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class UserInfo;
|
||||
|
||||
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;
|
||||
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
||||
void validate() override;
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value &json) override;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// LoginResponse members
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// LoginResponse members
|
||||
|
||||
std::shared_ptr<UserInfo> getUser() const;
|
||||
bool userIsSet() const;
|
||||
void unsetUser();
|
||||
void setUser(const std::shared_ptr<UserInfo>& value);
|
||||
std::shared_ptr<UserInfo> getUser() const;
|
||||
bool userIsSet() const;
|
||||
void unsetUser();
|
||||
void setUser(const std::shared_ptr<UserInfo> &value);
|
||||
|
||||
utility::string_t getAccessToken() const;
|
||||
bool accessTokenIsSet() const;
|
||||
void unsetAccess_token();
|
||||
void setAccessToken(const utility::string_t& value);
|
||||
utility::string_t getAccessToken() const;
|
||||
bool accessTokenIsSet() const;
|
||||
void unsetAccess_token();
|
||||
void setAccessToken(const utility::string_t &value);
|
||||
|
||||
utility::string_t getRefreshToken() const;
|
||||
bool refreshTokenIsSet() const;
|
||||
void unsetRefresh_token();
|
||||
void setRefreshToken(const utility::string_t& value);
|
||||
utility::string_t getRefreshToken() const;
|
||||
bool refreshTokenIsSet() const;
|
||||
void unsetRefresh_token();
|
||||
void setRefreshToken(const utility::string_t &value);
|
||||
|
||||
int64_t getExpiresIn() const;
|
||||
bool expiresInIsSet() const;
|
||||
void unsetExpires_in();
|
||||
void setExpiresIn(int64_t value);
|
||||
int64_t getExpiresIn() const;
|
||||
bool expiresInIsSet() const;
|
||||
void unsetExpires_in();
|
||||
void setExpiresIn(int64_t value);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<UserInfo> m_User;
|
||||
bool m_UserIsSet;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<UserInfo> m_User;
|
||||
bool m_UserIsSet;
|
||||
utility::string_t m_Access_token;
|
||||
bool m_Access_tokenIsSet;
|
||||
|
||||
utility::string_t m_Access_token;
|
||||
bool m_Access_tokenIsSet;
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
int64_t m_Expires_in;
|
||||
bool m_Expires_inIsSet;
|
||||
};
|
||||
|
||||
int64_t m_Expires_in;
|
||||
bool m_Expires_inIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_LoginResponse_H_ */
|
||||
|
@ -13,147 +13,142 @@
|
||||
/*
|
||||
* Package.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_Package_H_
|
||||
#define TRIBUFU_MODELS_Package_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class Package
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Package();
|
||||
virtual ~Package();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class Package : public ModelBase
|
||||
{
|
||||
public:
|
||||
Package();
|
||||
virtual ~Package();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t& value);
|
||||
utility::string_t getImageUrl() const;
|
||||
bool imageUrlIsSet() const;
|
||||
void unsetImage_url();
|
||||
void setImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getImageUrl() const;
|
||||
bool imageUrlIsSet() const;
|
||||
void unsetImage_url();
|
||||
void setImageUrl(const utility::string_t& value);
|
||||
utility::string_t getAuthorId() const;
|
||||
bool authorIdIsSet() const;
|
||||
void unsetAuthor_id();
|
||||
void setAuthorId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getAuthorId() const;
|
||||
bool authorIdIsSet() const;
|
||||
void unsetAuthor_id();
|
||||
void setAuthorId(const utility::string_t& value);
|
||||
utility::string_t getVersion() const;
|
||||
bool versionIsSet() const;
|
||||
void unsetVersion();
|
||||
void setVersion(const utility::string_t &value);
|
||||
|
||||
utility::string_t getVersion() const;
|
||||
bool versionIsSet() const;
|
||||
void unsetVersion();
|
||||
void setVersion(const utility::string_t& value);
|
||||
utility::string_t getFileUrl() const;
|
||||
bool fileUrlIsSet() const;
|
||||
void unsetFile_url();
|
||||
void setFileUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getFileUrl() const;
|
||||
bool fileUrlIsSet() const;
|
||||
void unsetFile_url();
|
||||
void setFileUrl(const utility::string_t& value);
|
||||
double getRawSize() const;
|
||||
bool rawSizeIsSet() const;
|
||||
void unsetRaw_size();
|
||||
void setRawSize(double value);
|
||||
|
||||
double getRawSize() const;
|
||||
bool rawSizeIsSet() const;
|
||||
void unsetRaw_size();
|
||||
void setRawSize(double value);
|
||||
int32_t getDownloadCount() const;
|
||||
bool downloadCountIsSet() const;
|
||||
void unsetDownload_count();
|
||||
void setDownloadCount(int32_t value);
|
||||
|
||||
int32_t getDownloadCount() const;
|
||||
bool downloadCountIsSet() const;
|
||||
void unsetDownload_count();
|
||||
void setDownloadCount(int32_t value);
|
||||
utility::datetime getLastDownload() const;
|
||||
bool lastDownloadIsSet() const;
|
||||
void unsetLast_download();
|
||||
void setLastDownload(const utility::datetime &value);
|
||||
|
||||
utility::datetime getLastDownload() const;
|
||||
bool lastDownloadIsSet() const;
|
||||
void unsetLast_download();
|
||||
void setLastDownload(const utility::datetime& value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Image_url;
|
||||
bool m_Image_urlIsSet;
|
||||
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
utility::string_t m_Author_id;
|
||||
bool m_Author_idIsSet;
|
||||
|
||||
utility::string_t m_Image_url;
|
||||
bool m_Image_urlIsSet;
|
||||
utility::string_t m_Version;
|
||||
bool m_VersionIsSet;
|
||||
|
||||
utility::string_t m_Author_id;
|
||||
bool m_Author_idIsSet;
|
||||
utility::string_t m_File_url;
|
||||
bool m_File_urlIsSet;
|
||||
|
||||
utility::string_t m_Version;
|
||||
bool m_VersionIsSet;
|
||||
double m_Raw_size;
|
||||
bool m_Raw_sizeIsSet;
|
||||
|
||||
utility::string_t m_File_url;
|
||||
bool m_File_urlIsSet;
|
||||
int32_t m_Download_count;
|
||||
bool m_Download_countIsSet;
|
||||
|
||||
double m_Raw_size;
|
||||
bool m_Raw_sizeIsSet;
|
||||
utility::datetime m_Last_download;
|
||||
bool m_Last_downloadIsSet;
|
||||
|
||||
int32_t m_Download_count;
|
||||
bool m_Download_countIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Last_download;
|
||||
bool m_Last_downloadIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_Package_H_ */
|
||||
|
@ -13,195 +13,190 @@
|
||||
/*
|
||||
* Profile.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_Profile_H_
|
||||
#define TRIBUFU_MODELS_Profile_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class Profile
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Profile();
|
||||
virtual ~Profile();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class Profile : public ModelBase
|
||||
{
|
||||
public:
|
||||
Profile();
|
||||
virtual ~Profile();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t &value);
|
||||
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t& value);
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
int32_t getLevel() const;
|
||||
bool levelIsSet() const;
|
||||
void unsetLevel();
|
||||
void setLevel(int32_t value);
|
||||
|
||||
int32_t getLevel() const;
|
||||
bool levelIsSet() const;
|
||||
void unsetLevel();
|
||||
void setLevel(int32_t value);
|
||||
double getExperience() const;
|
||||
bool experienceIsSet() const;
|
||||
void unsetExperience();
|
||||
void setExperience(double value);
|
||||
|
||||
double getExperience() const;
|
||||
bool experienceIsSet() const;
|
||||
void unsetExperience();
|
||||
void setExperience(double value);
|
||||
bool isPublicBirthday() const;
|
||||
bool publicBirthdayIsSet() const;
|
||||
void unsetPublic_birthday();
|
||||
void setPublicBirthday(bool value);
|
||||
|
||||
bool isPublicBirthday() const;
|
||||
bool publicBirthdayIsSet() const;
|
||||
void unsetPublic_birthday();
|
||||
void setPublicBirthday(bool value);
|
||||
utility::datetime getBirthday() const;
|
||||
bool birthdayIsSet() const;
|
||||
void unsetBirthday();
|
||||
void setBirthday(const utility::datetime &value);
|
||||
|
||||
utility::datetime getBirthday() const;
|
||||
bool birthdayIsSet() const;
|
||||
void unsetBirthday();
|
||||
void setBirthday(const utility::datetime& value);
|
||||
double getPoints() const;
|
||||
bool pointsIsSet() const;
|
||||
void unsetPoints();
|
||||
void setPoints(double value);
|
||||
|
||||
double getPoints() const;
|
||||
bool pointsIsSet() const;
|
||||
void unsetPoints();
|
||||
void setPoints(double value);
|
||||
utility::string_t getLocation() const;
|
||||
bool locationIsSet() const;
|
||||
void unsetLocation();
|
||||
void setLocation(const utility::string_t &value);
|
||||
|
||||
utility::string_t getLocation() const;
|
||||
bool locationIsSet() const;
|
||||
void unsetLocation();
|
||||
void setLocation(const utility::string_t& value);
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t& value);
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t& value);
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
void setLastOnline(const utility::datetime &value);
|
||||
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
void setLastOnline(const utility::datetime& value);
|
||||
utility::string_t getBiography() const;
|
||||
bool biographyIsSet() const;
|
||||
void unsetBiography();
|
||||
void setBiography(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBiography() const;
|
||||
bool biographyIsSet() const;
|
||||
void unsetBiography();
|
||||
void setBiography(const utility::string_t& value);
|
||||
int32_t getViewCount() const;
|
||||
bool viewCountIsSet() const;
|
||||
void unsetView_count();
|
||||
void setViewCount(int32_t value);
|
||||
|
||||
int32_t getViewCount() const;
|
||||
bool viewCountIsSet() const;
|
||||
void unsetView_count();
|
||||
void setViewCount(int32_t value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
int32_t m_Level;
|
||||
bool m_LevelIsSet;
|
||||
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
double m_Experience;
|
||||
bool m_ExperienceIsSet;
|
||||
|
||||
int32_t m_Level;
|
||||
bool m_LevelIsSet;
|
||||
bool m_Public_birthday;
|
||||
bool m_Public_birthdayIsSet;
|
||||
|
||||
double m_Experience;
|
||||
bool m_ExperienceIsSet;
|
||||
utility::datetime m_Birthday;
|
||||
bool m_BirthdayIsSet;
|
||||
|
||||
bool m_Public_birthday;
|
||||
bool m_Public_birthdayIsSet;
|
||||
double m_Points;
|
||||
bool m_PointsIsSet;
|
||||
|
||||
utility::datetime m_Birthday;
|
||||
bool m_BirthdayIsSet;
|
||||
utility::string_t m_Location;
|
||||
bool m_LocationIsSet;
|
||||
|
||||
double m_Points;
|
||||
bool m_PointsIsSet;
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
|
||||
utility::string_t m_Location;
|
||||
bool m_LocationIsSet;
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
utility::string_t m_Biography;
|
||||
bool m_BiographyIsSet;
|
||||
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
int32_t m_View_count;
|
||||
bool m_View_countIsSet;
|
||||
|
||||
utility::string_t m_Biography;
|
||||
bool m_BiographyIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
int32_t m_View_count;
|
||||
bool m_View_countIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_Profile_H_ */
|
||||
|
@ -13,140 +13,135 @@
|
||||
/*
|
||||
* ProfileGame.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_ProfileGame_H_
|
||||
#define TRIBUFU_MODELS_ProfileGame_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/AnyType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class ProfileGame
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
ProfileGame();
|
||||
virtual ~ProfileGame();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class ProfileGame : public ModelBase
|
||||
{
|
||||
public:
|
||||
ProfileGame();
|
||||
virtual ~ProfileGame();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getCapsuleImageUrl() const;
|
||||
bool capsuleImageUrlIsSet() const;
|
||||
void unsetCapsule_image_url();
|
||||
void setCapsuleImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCapsuleImageUrl() const;
|
||||
bool capsuleImageUrlIsSet() const;
|
||||
void unsetCapsule_image_url();
|
||||
void setCapsuleImageUrl(const utility::string_t& value);
|
||||
utility::string_t getLibraryImageUrl() const;
|
||||
bool libraryImageUrlIsSet() const;
|
||||
void unsetLibrary_image_url();
|
||||
void setLibraryImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getLibraryImageUrl() const;
|
||||
bool libraryImageUrlIsSet() const;
|
||||
void unsetLibrary_image_url();
|
||||
void setLibraryImageUrl(const utility::string_t& value);
|
||||
utility::string_t getSlug() const;
|
||||
bool slugIsSet() const;
|
||||
void unsetSlug();
|
||||
void setSlug(const utility::string_t &value);
|
||||
|
||||
utility::string_t getSlug() const;
|
||||
bool slugIsSet() const;
|
||||
void unsetSlug();
|
||||
void setSlug(const utility::string_t& value);
|
||||
double getTimeUsed() const;
|
||||
bool timeUsedIsSet() const;
|
||||
void unsetTime_used();
|
||||
void setTimeUsed(double value);
|
||||
|
||||
double getTimeUsed() const;
|
||||
bool timeUsedIsSet() const;
|
||||
void unsetTime_used();
|
||||
void setTimeUsed(double value);
|
||||
int32_t getUnlockedAchievements() const;
|
||||
bool unlockedAchievementsIsSet() const;
|
||||
void unsetUnlocked_achievements();
|
||||
void setUnlockedAchievements(int32_t value);
|
||||
|
||||
int32_t getUnlockedAchievements() const;
|
||||
bool unlockedAchievementsIsSet() const;
|
||||
void unsetUnlocked_achievements();
|
||||
void setUnlockedAchievements(int32_t value);
|
||||
int32_t getTotalAchievements() const;
|
||||
bool totalAchievementsIsSet() const;
|
||||
void unsetTotal_achievements();
|
||||
void setTotalAchievements(int32_t value);
|
||||
|
||||
int32_t getTotalAchievements() const;
|
||||
bool totalAchievementsIsSet() const;
|
||||
void unsetTotal_achievements();
|
||||
void setTotalAchievements(int32_t value);
|
||||
std::shared_ptr<AnyType> getStats() const;
|
||||
bool statsIsSet() const;
|
||||
void unsetStats();
|
||||
void setStats(const std::shared_ptr<AnyType> &value);
|
||||
|
||||
std::shared_ptr<AnyType> getStats() const;
|
||||
bool statsIsSet() const;
|
||||
void unsetStats();
|
||||
void setStats(const std::shared_ptr<AnyType>& value);
|
||||
utility::datetime getAcquired() const;
|
||||
bool acquiredIsSet() const;
|
||||
void unsetAcquired();
|
||||
void setAcquired(const utility::datetime &value);
|
||||
|
||||
utility::datetime getAcquired() const;
|
||||
bool acquiredIsSet() const;
|
||||
void unsetAcquired();
|
||||
void setAcquired(const utility::datetime& value);
|
||||
utility::datetime getLastUsed() const;
|
||||
bool lastUsedIsSet() const;
|
||||
void unsetLast_used();
|
||||
void setLastUsed(const utility::datetime &value);
|
||||
|
||||
utility::datetime getLastUsed() const;
|
||||
bool lastUsedIsSet() const;
|
||||
void unsetLast_used();
|
||||
void setLastUsed(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Capsule_image_url;
|
||||
bool m_Capsule_image_urlIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Library_image_url;
|
||||
bool m_Library_image_urlIsSet;
|
||||
|
||||
utility::string_t m_Capsule_image_url;
|
||||
bool m_Capsule_image_urlIsSet;
|
||||
utility::string_t m_Slug;
|
||||
bool m_SlugIsSet;
|
||||
|
||||
utility::string_t m_Library_image_url;
|
||||
bool m_Library_image_urlIsSet;
|
||||
double m_Time_used;
|
||||
bool m_Time_usedIsSet;
|
||||
|
||||
utility::string_t m_Slug;
|
||||
bool m_SlugIsSet;
|
||||
int32_t m_Unlocked_achievements;
|
||||
bool m_Unlocked_achievementsIsSet;
|
||||
|
||||
double m_Time_used;
|
||||
bool m_Time_usedIsSet;
|
||||
int32_t m_Total_achievements;
|
||||
bool m_Total_achievementsIsSet;
|
||||
|
||||
int32_t m_Unlocked_achievements;
|
||||
bool m_Unlocked_achievementsIsSet;
|
||||
std::shared_ptr<AnyType> m_Stats;
|
||||
bool m_StatsIsSet;
|
||||
|
||||
int32_t m_Total_achievements;
|
||||
bool m_Total_achievementsIsSet;
|
||||
utility::datetime m_Acquired;
|
||||
bool m_AcquiredIsSet;
|
||||
|
||||
std::shared_ptr<AnyType> m_Stats;
|
||||
bool m_StatsIsSet;
|
||||
utility::datetime m_Last_used;
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* ProfileGroup.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_ProfileGroup_H_
|
||||
@ -23,123 +23,119 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/GroupRank.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class ProfileGroup
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
ProfileGroup();
|
||||
virtual ~ProfileGroup();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class ProfileGroup : public ModelBase
|
||||
{
|
||||
public:
|
||||
ProfileGroup();
|
||||
virtual ~ProfileGroup();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t &value);
|
||||
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getTag() const;
|
||||
bool tagIsSet() const;
|
||||
void unsetTag();
|
||||
void setTag(const utility::string_t &value);
|
||||
|
||||
utility::string_t getTag() const;
|
||||
bool tagIsSet() const;
|
||||
void unsetTag();
|
||||
void setTag(const utility::string_t& value);
|
||||
int32_t getPrivacy() const;
|
||||
bool privacyIsSet() const;
|
||||
void unsetPrivacy();
|
||||
void setPrivacy(int32_t value);
|
||||
|
||||
int32_t getPrivacy() const;
|
||||
bool privacyIsSet() const;
|
||||
void unsetPrivacy();
|
||||
void setPrivacy(int32_t value);
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t& value);
|
||||
int32_t getMemberCount() const;
|
||||
bool memberCountIsSet() const;
|
||||
void unsetMember_count();
|
||||
void setMemberCount(int32_t value);
|
||||
|
||||
int32_t getMemberCount() const;
|
||||
bool memberCountIsSet() const;
|
||||
void unsetMember_count();
|
||||
void setMemberCount(int32_t value);
|
||||
std::shared_ptr<GroupRank> getRank() const;
|
||||
bool rankIsSet() const;
|
||||
void unsetRank();
|
||||
void setRank(const std::shared_ptr<GroupRank> &value);
|
||||
|
||||
std::shared_ptr<GroupRank> getRank() const;
|
||||
bool rankIsSet() const;
|
||||
void unsetRank();
|
||||
void setRank(const std::shared_ptr<GroupRank>& value);
|
||||
utility::datetime getSince() const;
|
||||
bool sinceIsSet() const;
|
||||
void unsetSince();
|
||||
void setSince(const utility::datetime &value);
|
||||
|
||||
utility::datetime getSince() const;
|
||||
bool sinceIsSet() const;
|
||||
void unsetSince();
|
||||
void setSince(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
utility::string_t m_Tag;
|
||||
bool m_TagIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
int32_t m_Privacy;
|
||||
bool m_PrivacyIsSet;
|
||||
|
||||
utility::string_t m_Tag;
|
||||
bool m_TagIsSet;
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
|
||||
int32_t m_Privacy;
|
||||
bool m_PrivacyIsSet;
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
int32_t m_Member_count;
|
||||
bool m_Member_countIsSet;
|
||||
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
std::shared_ptr<GroupRank> m_Rank;
|
||||
bool m_RankIsSet;
|
||||
|
||||
int32_t m_Member_count;
|
||||
bool m_Member_countIsSet;
|
||||
utility::datetime m_Since;
|
||||
bool m_SinceIsSet;
|
||||
};
|
||||
|
||||
std::shared_ptr<GroupRank> m_Rank;
|
||||
bool m_RankIsSet;
|
||||
|
||||
utility::datetime m_Since;
|
||||
bool m_SinceIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_ProfileGroup_H_ */
|
||||
|
@ -13,59 +13,54 @@
|
||||
/*
|
||||
* RefreshRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_RefreshRequest_H_
|
||||
#define TRIBUFU_MODELS_RefreshRequest_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class RefreshRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
RefreshRequest();
|
||||
virtual ~RefreshRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class RefreshRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
RefreshRequest();
|
||||
virtual ~RefreshRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool refreshTokenIsSet() const;
|
||||
void unsetRefresh_token();
|
||||
void setRefreshToken(const utility::string_t& value);
|
||||
protected:
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
};
|
||||
|
||||
|
||||
protected:
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_RefreshRequest_H_ */
|
||||
|
@ -13,83 +13,78 @@
|
||||
/*
|
||||
* RegisterRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_RegisterRequest_H_
|
||||
#define TRIBUFU_MODELS_RegisterRequest_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class RegisterRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
RegisterRequest();
|
||||
virtual ~RegisterRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class RegisterRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
RegisterRequest();
|
||||
virtual ~RegisterRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getEmail() const;
|
||||
bool emailIsSet() const;
|
||||
void unsetEmail();
|
||||
void setEmail(const utility::string_t &value);
|
||||
|
||||
utility::string_t getEmail() const;
|
||||
bool emailIsSet() const;
|
||||
void unsetEmail();
|
||||
void setEmail(const utility::string_t& value);
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_t& value);
|
||||
protected:
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
utility::string_t m_Email;
|
||||
bool m_EmailIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
};
|
||||
|
||||
utility::string_t m_Email;
|
||||
bool m_EmailIsSet;
|
||||
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_RegisterRequest_H_ */
|
||||
|
@ -13,52 +13,52 @@
|
||||
/*
|
||||
* ResponseType.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_ResponseType_H_
|
||||
#define TRIBUFU_MODELS_ResponseType_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class ResponseType
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
ResponseType_CODE,
|
||||
ResponseType_TOKEN,
|
||||
};
|
||||
|
||||
eResponseType getValue() const;
|
||||
void setValue(eResponseType const value);
|
||||
class ResponseType : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* RevokeRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_RevokeRequest_H_
|
||||
@ -23,59 +23,55 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/TokenHintType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class RevokeRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
RevokeRequest();
|
||||
virtual ~RevokeRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class RevokeRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
RevokeRequest();
|
||||
virtual ~RevokeRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool tokenIsSet() const;
|
||||
void unsetToken();
|
||||
void setToken(const utility::string_t& value);
|
||||
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
||||
bool tokenTypeHintIsSet() const;
|
||||
void unsetToken_type_hint();
|
||||
void setTokenTypeHint(const std::shared_ptr<TokenHintType> &value);
|
||||
|
||||
std::shared_ptr<TokenHintType> getTokenTypeHint() const;
|
||||
bool tokenTypeHintIsSet() const;
|
||||
void unsetToken_type_hint();
|
||||
void setTokenTypeHint(const std::shared_ptr<TokenHintType>& value);
|
||||
protected:
|
||||
utility::string_t m_Token;
|
||||
bool m_TokenIsSet;
|
||||
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* SearchRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_SearchRequest_H_
|
||||
@ -26,72 +26,68 @@
|
||||
#include "tribufu++/model/SearchType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class SearchRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
SearchRequest();
|
||||
virtual ~SearchRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class SearchRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
SearchRequest();
|
||||
virtual ~SearchRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(const std::shared_ptr<SearchType>& value);
|
||||
utility::string_t getQuery() const;
|
||||
bool queryIsSet() const;
|
||||
void unsetQuery();
|
||||
void setQuery(const utility::string_t &value);
|
||||
|
||||
utility::string_t getQuery() const;
|
||||
bool queryIsSet() const;
|
||||
void unsetQuery();
|
||||
void setQuery(const utility::string_t& value);
|
||||
int32_t getPage() const;
|
||||
bool pageIsSet() const;
|
||||
void unsetPage();
|
||||
void setPage(int32_t value);
|
||||
|
||||
int32_t getPage() const;
|
||||
bool pageIsSet() const;
|
||||
void unsetPage();
|
||||
void setPage(int32_t value);
|
||||
utility::string_t getGameId() const;
|
||||
bool gameIdIsSet() const;
|
||||
void unsetGame_id();
|
||||
void setGameId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getGameId() const;
|
||||
bool gameIdIsSet() const;
|
||||
void unsetGame_id();
|
||||
void setGameId(const utility::string_t& value);
|
||||
protected:
|
||||
std::shared_ptr<SearchType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
|
||||
utility::string_t m_Query;
|
||||
bool m_QueryIsSet;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<SearchType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
int32_t m_Page;
|
||||
bool m_PageIsSet;
|
||||
|
||||
utility::string_t m_Query;
|
||||
bool m_QueryIsSet;
|
||||
utility::string_t m_Game_id;
|
||||
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_ */
|
||||
|
@ -13,54 +13,54 @@
|
||||
/*
|
||||
* SearchType.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_SearchType_H_
|
||||
#define TRIBUFU_MODELS_SearchType_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class SearchType
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
SearchType_USER,
|
||||
SearchType_GROUP,
|
||||
SearchType_SERVER,
|
||||
SearchType_CLUSTER,
|
||||
};
|
||||
|
||||
eSearchType getValue() const;
|
||||
void setValue(eSearchType const value);
|
||||
class SearchType : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,74 +13,68 @@
|
||||
/*
|
||||
* ServerMetrics.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_ServerMetrics_H_
|
||||
#define TRIBUFU_MODELS_ServerMetrics_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class ServerMetrics
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
ServerMetrics();
|
||||
virtual ~ServerMetrics();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class ServerMetrics : public ModelBase
|
||||
{
|
||||
public:
|
||||
ServerMetrics();
|
||||
virtual ~ServerMetrics();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ServerMetrics members
|
||||
/////////////////////////////////////////////
|
||||
/// ServerMetrics members
|
||||
|
||||
int32_t getServerCount() const;
|
||||
bool serverCountIsSet() const;
|
||||
void unsetServer_count();
|
||||
void setServerCount(int32_t value);
|
||||
|
||||
int32_t getServerCount() const;
|
||||
bool serverCountIsSet() const;
|
||||
void unsetServer_count();
|
||||
void setServerCount(int32_t value);
|
||||
int32_t getPackageCount() const;
|
||||
bool packageCountIsSet() const;
|
||||
void unsetPackage_count();
|
||||
void setPackageCount(int32_t value);
|
||||
|
||||
int32_t getPackageCount() const;
|
||||
bool packageCountIsSet() const;
|
||||
void unsetPackage_count();
|
||||
void setPackageCount(int32_t value);
|
||||
int32_t getCountryCount() const;
|
||||
bool countryCountIsSet() const;
|
||||
void unsetCountry_count();
|
||||
void setCountryCount(int32_t value);
|
||||
|
||||
int32_t getCountryCount() const;
|
||||
bool countryCountIsSet() const;
|
||||
void unsetCountry_count();
|
||||
void setCountryCount(int32_t value);
|
||||
protected:
|
||||
int32_t m_Server_count;
|
||||
bool m_Server_countIsSet;
|
||||
|
||||
int32_t m_Package_count;
|
||||
bool m_Package_countIsSet;
|
||||
|
||||
protected:
|
||||
int32_t m_Server_count;
|
||||
bool m_Server_countIsSet;
|
||||
int32_t m_Country_count;
|
||||
bool m_Country_countIsSet;
|
||||
};
|
||||
|
||||
int32_t m_Package_count;
|
||||
bool m_Package_countIsSet;
|
||||
|
||||
int32_t m_Country_count;
|
||||
bool m_Country_countIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_ServerMetrics_H_ */
|
||||
|
@ -13,53 +13,53 @@
|
||||
/*
|
||||
* ServerStatus.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_ServerStatus_H_
|
||||
#define TRIBUFU_MODELS_ServerStatus_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class ServerStatus
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
ServerStatus_UNKNOWN,
|
||||
ServerStatus_OFFLINE,
|
||||
ServerStatus_ONLINE,
|
||||
};
|
||||
|
||||
eServerStatus getValue() const;
|
||||
void setValue(eServerStatus const value);
|
||||
class ServerStatus : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,108 +13,103 @@
|
||||
/*
|
||||
* Subscription.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_Subscription_H_
|
||||
#define TRIBUFU_MODELS_Subscription_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <map>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class Subscription
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
Subscription();
|
||||
virtual ~Subscription();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class Subscription : public ModelBase
|
||||
{
|
||||
public:
|
||||
Subscription();
|
||||
virtual ~Subscription();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDescription() const;
|
||||
bool descriptionIsSet() const;
|
||||
void unsetDescription();
|
||||
void setDescription(const utility::string_t& value);
|
||||
utility::string_t getImageUrl() const;
|
||||
bool imageUrlIsSet() const;
|
||||
void unsetImage_url();
|
||||
void setImageUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getImageUrl() const;
|
||||
bool imageUrlIsSet() const;
|
||||
void unsetImage_url();
|
||||
void setImageUrl(const utility::string_t& value);
|
||||
std::map<utility::string_t, double> getPrices() const;
|
||||
bool pricesIsSet() const;
|
||||
void unsetPrices();
|
||||
void setPrices(std::map<utility::string_t, double> value);
|
||||
|
||||
std::map<utility::string_t, double> getPrices() const;
|
||||
bool pricesIsSet() const;
|
||||
void unsetPrices();
|
||||
void setPrices(std::map<utility::string_t, double> value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Image_url;
|
||||
bool m_Image_urlIsSet;
|
||||
|
||||
utility::string_t m_Description;
|
||||
bool m_DescriptionIsSet;
|
||||
std::map<utility::string_t, double> m_Prices;
|
||||
bool m_PricesIsSet;
|
||||
|
||||
utility::string_t m_Image_url;
|
||||
bool m_Image_urlIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
std::map<utility::string_t, double> m_Prices;
|
||||
bool m_PricesIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_Subscription_H_ */
|
||||
|
@ -13,52 +13,52 @@
|
||||
/*
|
||||
* TokenHintType.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_TokenHintType_H_
|
||||
#define TRIBUFU_MODELS_TokenHintType_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class TokenHintType
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
TokenHintType_ACCESS_TOKEN,
|
||||
TokenHintType_REFRESH_TOKEN,
|
||||
};
|
||||
|
||||
eTokenHintType getValue() const;
|
||||
void setValue(eTokenHintType const value);
|
||||
class TokenHintType : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* TokenRequest.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_TokenRequest_H_
|
||||
@ -23,107 +23,103 @@
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include "tribufu++/model/GrantType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class TokenRequest
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
TokenRequest();
|
||||
virtual ~TokenRequest();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class TokenRequest : public ModelBase
|
||||
{
|
||||
public:
|
||||
TokenRequest();
|
||||
virtual ~TokenRequest();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool grantTypeIsSet() const;
|
||||
void unsetGrant_type();
|
||||
void setGrantType(const std::shared_ptr<GrantType>& value);
|
||||
utility::string_t getCode() const;
|
||||
bool codeIsSet() const;
|
||||
void unsetCode();
|
||||
void setCode(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCode() const;
|
||||
bool codeIsSet() const;
|
||||
void unsetCode();
|
||||
void setCode(const utility::string_t& value);
|
||||
utility::string_t getUsername() const;
|
||||
bool usernameIsSet() const;
|
||||
void unsetUsername();
|
||||
void setUsername(const utility::string_t &value);
|
||||
|
||||
utility::string_t getUsername() const;
|
||||
bool usernameIsSet() const;
|
||||
void unsetUsername();
|
||||
void setUsername(const utility::string_t& value);
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPassword() const;
|
||||
bool passwordIsSet() const;
|
||||
void unsetPassword();
|
||||
void setPassword(const utility::string_t& value);
|
||||
utility::string_t getRefreshToken() const;
|
||||
bool refreshTokenIsSet() const;
|
||||
void unsetRefresh_token();
|
||||
void setRefreshToken(const utility::string_t &value);
|
||||
|
||||
utility::string_t getRefreshToken() const;
|
||||
bool refreshTokenIsSet() const;
|
||||
void unsetRefresh_token();
|
||||
void setRefreshToken(const utility::string_t& value);
|
||||
utility::string_t getClientId() const;
|
||||
bool clientIdIsSet() const;
|
||||
void unsetClient_id();
|
||||
void setClientId(const utility::string_t &value);
|
||||
|
||||
utility::string_t getClientId() const;
|
||||
bool clientIdIsSet() const;
|
||||
void unsetClient_id();
|
||||
void setClientId(const utility::string_t& value);
|
||||
utility::string_t getRedirectUri() const;
|
||||
bool redirectUriIsSet() const;
|
||||
void unsetRedirect_uri();
|
||||
void setRedirectUri(const utility::string_t &value);
|
||||
|
||||
utility::string_t getRedirectUri() const;
|
||||
bool redirectUriIsSet() const;
|
||||
void unsetRedirect_uri();
|
||||
void setRedirectUri(const utility::string_t& value);
|
||||
utility::string_t getCodeVerifier() const;
|
||||
bool codeVerifierIsSet() const;
|
||||
void unsetCode_verifier();
|
||||
void setCodeVerifier(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCodeVerifier() const;
|
||||
bool codeVerifierIsSet() const;
|
||||
void unsetCode_verifier();
|
||||
void setCodeVerifier(const utility::string_t& value);
|
||||
protected:
|
||||
std::shared_ptr<GrantType> m_Grant_type;
|
||||
bool m_Grant_typeIsSet;
|
||||
|
||||
utility::string_t m_Code;
|
||||
bool m_CodeIsSet;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<GrantType> m_Grant_type;
|
||||
bool m_Grant_typeIsSet;
|
||||
utility::string_t m_Username;
|
||||
bool m_UsernameIsSet;
|
||||
|
||||
utility::string_t m_Code;
|
||||
bool m_CodeIsSet;
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
|
||||
utility::string_t m_Username;
|
||||
bool m_UsernameIsSet;
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
|
||||
utility::string_t m_Password;
|
||||
bool m_PasswordIsSet;
|
||||
utility::string_t m_Client_id;
|
||||
bool m_Client_idIsSet;
|
||||
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
utility::string_t m_Redirect_uri;
|
||||
bool m_Redirect_uriIsSet;
|
||||
|
||||
utility::string_t m_Client_id;
|
||||
bool m_Client_idIsSet;
|
||||
utility::string_t m_Code_verifier;
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* TokenResponse.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_TokenResponse_H_
|
||||
@ -26,88 +26,84 @@
|
||||
#include "tribufu++/model/TokenType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class TokenResponse
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
TokenResponse();
|
||||
virtual ~TokenResponse();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class TokenResponse : public ModelBase
|
||||
{
|
||||
public:
|
||||
TokenResponse();
|
||||
virtual ~TokenResponse();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool tokenTypeIsSet() const;
|
||||
void unsetToken_type();
|
||||
void setTokenType(const std::shared_ptr<TokenType>& value);
|
||||
utility::string_t getAccessToken() const;
|
||||
bool accessTokenIsSet() const;
|
||||
void unsetAccess_token();
|
||||
void setAccessToken(const utility::string_t &value);
|
||||
|
||||
utility::string_t getAccessToken() const;
|
||||
bool accessTokenIsSet() const;
|
||||
void unsetAccess_token();
|
||||
void setAccessToken(const utility::string_t& value);
|
||||
utility::string_t getRefreshToken() const;
|
||||
bool refreshTokenIsSet() const;
|
||||
void unsetRefresh_token();
|
||||
void setRefreshToken(const utility::string_t &value);
|
||||
|
||||
utility::string_t getRefreshToken() const;
|
||||
bool refreshTokenIsSet() const;
|
||||
void unsetRefresh_token();
|
||||
void setRefreshToken(const utility::string_t& value);
|
||||
utility::string_t getScope() const;
|
||||
bool scopeIsSet() const;
|
||||
void unsetScope();
|
||||
void setScope(const utility::string_t &value);
|
||||
|
||||
utility::string_t getScope() const;
|
||||
bool scopeIsSet() const;
|
||||
void unsetScope();
|
||||
void setScope(const utility::string_t& value);
|
||||
utility::string_t getState() const;
|
||||
bool stateIsSet() const;
|
||||
void unsetState();
|
||||
void setState(const utility::string_t &value);
|
||||
|
||||
utility::string_t getState() const;
|
||||
bool stateIsSet() const;
|
||||
void unsetState();
|
||||
void setState(const utility::string_t& value);
|
||||
int64_t getExpiresIn() const;
|
||||
bool expiresInIsSet() const;
|
||||
void unsetExpires_in();
|
||||
void setExpiresIn(int64_t value);
|
||||
|
||||
int64_t getExpiresIn() const;
|
||||
bool expiresInIsSet() const;
|
||||
void unsetExpires_in();
|
||||
void setExpiresIn(int64_t value);
|
||||
protected:
|
||||
std::shared_ptr<TokenType> m_Token_type;
|
||||
bool m_Token_typeIsSet;
|
||||
|
||||
utility::string_t m_Access_token;
|
||||
bool m_Access_tokenIsSet;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<TokenType> m_Token_type;
|
||||
bool m_Token_typeIsSet;
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
|
||||
utility::string_t m_Access_token;
|
||||
bool m_Access_tokenIsSet;
|
||||
utility::string_t m_Scope;
|
||||
bool m_ScopeIsSet;
|
||||
|
||||
utility::string_t m_Refresh_token;
|
||||
bool m_Refresh_tokenIsSet;
|
||||
utility::string_t m_State;
|
||||
bool m_StateIsSet;
|
||||
|
||||
utility::string_t m_Scope;
|
||||
bool m_ScopeIsSet;
|
||||
int64_t m_Expires_in;
|
||||
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_ */
|
||||
|
@ -13,51 +13,51 @@
|
||||
/*
|
||||
* TokenType.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_TokenType_H_
|
||||
#define TRIBUFU_MODELS_TokenType_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class TokenType
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
TokenType_BEARER,
|
||||
};
|
||||
|
||||
eTokenType getValue() const;
|
||||
void setValue(eTokenType const value);
|
||||
class TokenType : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -13,67 +13,62 @@
|
||||
/*
|
||||
* UpdateProfile.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_UpdateProfile_H_
|
||||
#define TRIBUFU_MODELS_UpdateProfile_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class UpdateProfile
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
UpdateProfile();
|
||||
virtual ~UpdateProfile();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class UpdateProfile : public ModelBase
|
||||
{
|
||||
public:
|
||||
UpdateProfile();
|
||||
virtual ~UpdateProfile();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t& value);
|
||||
utility::string_t getBiography() const;
|
||||
bool biographyIsSet() const;
|
||||
void unsetBiography();
|
||||
void setBiography(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBiography() const;
|
||||
bool biographyIsSet() const;
|
||||
void unsetBiography();
|
||||
void setBiography(const utility::string_t& value);
|
||||
protected:
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
|
||||
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_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* UserInfo.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_UserInfo_H_
|
||||
@ -26,240 +26,236 @@
|
||||
#include "tribufu++/model/UserType.h"
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
|
||||
class UserInfo
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
UserInfo();
|
||||
virtual ~UserInfo();
|
||||
namespace models
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
class UserInfo : public ModelBase
|
||||
{
|
||||
public:
|
||||
UserInfo();
|
||||
virtual ~UserInfo();
|
||||
|
||||
void validate() override;
|
||||
/////////////////////////////////////////////
|
||||
/// ModelBase overrides
|
||||
|
||||
web::json::value toJson() const override;
|
||||
bool fromJson(const web::json::value& json) override;
|
||||
void validate() 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;
|
||||
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;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// 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;
|
||||
bool idIsSet() const;
|
||||
void unsetId();
|
||||
void setId(const utility::string_t& value);
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t &value);
|
||||
|
||||
utility::string_t getUuid() const;
|
||||
bool uuidIsSet() const;
|
||||
void unsetUuid();
|
||||
void setUuid(const utility::string_t& value);
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getName() const;
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
void setName(const utility::string_t& value);
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t &value);
|
||||
|
||||
utility::string_t getDisplayName() const;
|
||||
bool displayNameIsSet() const;
|
||||
void unsetDisplay_name();
|
||||
void setDisplayName(const utility::string_t& value);
|
||||
utility::string_t getEmail() const;
|
||||
bool emailIsSet() const;
|
||||
void unsetEmail();
|
||||
void setEmail(const utility::string_t &value);
|
||||
|
||||
utility::string_t getEmail() const;
|
||||
bool emailIsSet() const;
|
||||
void unsetEmail();
|
||||
void setEmail(const utility::string_t& value);
|
||||
std::shared_ptr<UserType> getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(const std::shared_ptr<UserType> &value);
|
||||
|
||||
std::shared_ptr<UserType> getType() const;
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
void setType(const std::shared_ptr<UserType>& value);
|
||||
utility::string_t getFlags() const;
|
||||
bool flagsIsSet() const;
|
||||
void unsetFlags();
|
||||
void setFlags(const utility::string_t &value);
|
||||
|
||||
utility::string_t getFlags() const;
|
||||
bool flagsIsSet() const;
|
||||
void unsetFlags();
|
||||
void setFlags(const utility::string_t& value);
|
||||
utility::string_t getPermissions() const;
|
||||
bool permissionsIsSet() const;
|
||||
void unsetPermissions();
|
||||
void setPermissions(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPermissions() const;
|
||||
bool permissionsIsSet() const;
|
||||
void unsetPermissions();
|
||||
void setPermissions(const utility::string_t& value);
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
|
||||
bool isVerified() const;
|
||||
bool verifiedIsSet() const;
|
||||
void unsetVerified();
|
||||
void setVerified(bool value);
|
||||
int32_t getLevel() const;
|
||||
bool levelIsSet() const;
|
||||
void unsetLevel();
|
||||
void setLevel(int32_t value);
|
||||
|
||||
int32_t getLevel() const;
|
||||
bool levelIsSet() const;
|
||||
void unsetLevel();
|
||||
void setLevel(int32_t value);
|
||||
double getExperience() const;
|
||||
bool experienceIsSet() const;
|
||||
void unsetExperience();
|
||||
void setExperience(double value);
|
||||
|
||||
double getExperience() const;
|
||||
bool experienceIsSet() const;
|
||||
void unsetExperience();
|
||||
void setExperience(double value);
|
||||
bool isPublicBirthday() const;
|
||||
bool publicBirthdayIsSet() const;
|
||||
void unsetPublic_birthday();
|
||||
void setPublicBirthday(bool value);
|
||||
|
||||
bool isPublicBirthday() const;
|
||||
bool publicBirthdayIsSet() const;
|
||||
void unsetPublic_birthday();
|
||||
void setPublicBirthday(bool value);
|
||||
utility::datetime getBirthday() const;
|
||||
bool birthdayIsSet() const;
|
||||
void unsetBirthday();
|
||||
void setBirthday(const utility::datetime &value);
|
||||
|
||||
utility::datetime getBirthday() const;
|
||||
bool birthdayIsSet() const;
|
||||
void unsetBirthday();
|
||||
void setBirthday(const utility::datetime& value);
|
||||
double getPoints() const;
|
||||
bool pointsIsSet() const;
|
||||
void unsetPoints();
|
||||
void setPoints(double value);
|
||||
|
||||
double getPoints() const;
|
||||
bool pointsIsSet() const;
|
||||
void unsetPoints();
|
||||
void setPoints(double value);
|
||||
utility::string_t getLocation() const;
|
||||
bool locationIsSet() const;
|
||||
void unsetLocation();
|
||||
void setLocation(const utility::string_t &value);
|
||||
|
||||
utility::string_t getLocation() const;
|
||||
bool locationIsSet() const;
|
||||
void unsetLocation();
|
||||
void setLocation(const utility::string_t& value);
|
||||
utility::string_t getLanguage() const;
|
||||
bool languageIsSet() const;
|
||||
void unsetLanguage();
|
||||
void setLanguage(const utility::string_t &value);
|
||||
|
||||
utility::string_t getLanguage() const;
|
||||
bool languageIsSet() const;
|
||||
void unsetLanguage();
|
||||
void setLanguage(const utility::string_t& value);
|
||||
utility::string_t getTimezone() const;
|
||||
bool timezoneIsSet() const;
|
||||
void unsetTimezone();
|
||||
void setTimezone(const utility::string_t &value);
|
||||
|
||||
utility::string_t getTimezone() const;
|
||||
bool timezoneIsSet() const;
|
||||
void unsetTimezone();
|
||||
void setTimezone(const utility::string_t& value);
|
||||
utility::string_t getCurrency() const;
|
||||
bool currencyIsSet() const;
|
||||
void unsetCurrency();
|
||||
void setCurrency(const utility::string_t &value);
|
||||
|
||||
utility::string_t getCurrency() const;
|
||||
bool currencyIsSet() const;
|
||||
void unsetCurrency();
|
||||
void setCurrency(const utility::string_t& value);
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getPhotoUrl() const;
|
||||
bool photoUrlIsSet() const;
|
||||
void unsetPhoto_url();
|
||||
void setPhotoUrl(const utility::string_t& value);
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBannerUrl() const;
|
||||
bool bannerUrlIsSet() const;
|
||||
void unsetBanner_url();
|
||||
void setBannerUrl(const utility::string_t& value);
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
void setLastOnline(const utility::datetime &value);
|
||||
|
||||
utility::datetime getLastOnline() const;
|
||||
bool lastOnlineIsSet() const;
|
||||
void unsetLast_online();
|
||||
void setLastOnline(const utility::datetime& value);
|
||||
utility::string_t getBiography() const;
|
||||
bool biographyIsSet() const;
|
||||
void unsetBiography();
|
||||
void setBiography(const utility::string_t &value);
|
||||
|
||||
utility::string_t getBiography() const;
|
||||
bool biographyIsSet() const;
|
||||
void unsetBiography();
|
||||
void setBiography(const utility::string_t& value);
|
||||
int32_t getViewCount() const;
|
||||
bool viewCountIsSet() const;
|
||||
void unsetView_count();
|
||||
void setViewCount(int32_t value);
|
||||
|
||||
int32_t getViewCount() const;
|
||||
bool viewCountIsSet() const;
|
||||
void unsetView_count();
|
||||
void setViewCount(int32_t value);
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getCreated() const;
|
||||
bool createdIsSet() const;
|
||||
void unsetCreated();
|
||||
void setCreated(const utility::datetime& value);
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime &value);
|
||||
|
||||
utility::datetime getUpdated() const;
|
||||
bool updatedIsSet() const;
|
||||
void unsetUpdated();
|
||||
void setUpdated(const utility::datetime& value);
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
|
||||
protected:
|
||||
utility::string_t m_Id;
|
||||
bool m_IdIsSet;
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
|
||||
utility::string_t m_Uuid;
|
||||
bool m_UuidIsSet;
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
|
||||
utility::string_t m_Name;
|
||||
bool m_NameIsSet;
|
||||
utility::string_t m_Email;
|
||||
bool m_EmailIsSet;
|
||||
|
||||
utility::string_t m_Display_name;
|
||||
bool m_Display_nameIsSet;
|
||||
std::shared_ptr<UserType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
|
||||
utility::string_t m_Email;
|
||||
bool m_EmailIsSet;
|
||||
utility::string_t m_Flags;
|
||||
bool m_FlagsIsSet;
|
||||
|
||||
std::shared_ptr<UserType> m_Type;
|
||||
bool m_TypeIsSet;
|
||||
utility::string_t m_Permissions;
|
||||
bool m_PermissionsIsSet;
|
||||
|
||||
utility::string_t m_Flags;
|
||||
bool m_FlagsIsSet;
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
|
||||
utility::string_t m_Permissions;
|
||||
bool m_PermissionsIsSet;
|
||||
int32_t m_Level;
|
||||
bool m_LevelIsSet;
|
||||
|
||||
bool m_Verified;
|
||||
bool m_VerifiedIsSet;
|
||||
double m_Experience;
|
||||
bool m_ExperienceIsSet;
|
||||
|
||||
int32_t m_Level;
|
||||
bool m_LevelIsSet;
|
||||
bool m_Public_birthday;
|
||||
bool m_Public_birthdayIsSet;
|
||||
|
||||
double m_Experience;
|
||||
bool m_ExperienceIsSet;
|
||||
utility::datetime m_Birthday;
|
||||
bool m_BirthdayIsSet;
|
||||
|
||||
bool m_Public_birthday;
|
||||
bool m_Public_birthdayIsSet;
|
||||
double m_Points;
|
||||
bool m_PointsIsSet;
|
||||
|
||||
utility::datetime m_Birthday;
|
||||
bool m_BirthdayIsSet;
|
||||
utility::string_t m_Location;
|
||||
bool m_LocationIsSet;
|
||||
|
||||
double m_Points;
|
||||
bool m_PointsIsSet;
|
||||
utility::string_t m_Language;
|
||||
bool m_LanguageIsSet;
|
||||
|
||||
utility::string_t m_Location;
|
||||
bool m_LocationIsSet;
|
||||
utility::string_t m_Timezone;
|
||||
bool m_TimezoneIsSet;
|
||||
|
||||
utility::string_t m_Language;
|
||||
bool m_LanguageIsSet;
|
||||
utility::string_t m_Currency;
|
||||
bool m_CurrencyIsSet;
|
||||
|
||||
utility::string_t m_Timezone;
|
||||
bool m_TimezoneIsSet;
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
|
||||
utility::string_t m_Currency;
|
||||
bool m_CurrencyIsSet;
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
|
||||
utility::string_t m_Photo_url;
|
||||
bool m_Photo_urlIsSet;
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
|
||||
utility::string_t m_Banner_url;
|
||||
bool m_Banner_urlIsSet;
|
||||
utility::string_t m_Biography;
|
||||
bool m_BiographyIsSet;
|
||||
|
||||
utility::datetime m_Last_online;
|
||||
bool m_Last_onlineIsSet;
|
||||
int32_t m_View_count;
|
||||
bool m_View_countIsSet;
|
||||
|
||||
utility::string_t m_Biography;
|
||||
bool m_BiographyIsSet;
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
int32_t m_View_count;
|
||||
bool m_View_countIsSet;
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
};
|
||||
|
||||
utility::datetime m_Created;
|
||||
bool m_CreatedIsSet;
|
||||
|
||||
utility::datetime m_Updated;
|
||||
bool m_UpdatedIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TRIBUFU_MODELS_UserInfo_H_ */
|
||||
|
@ -13,52 +13,52 @@
|
||||
/*
|
||||
* UserType.h
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TRIBUFU_MODELS_UserType_H_
|
||||
#define TRIBUFU_MODELS_UserType_H_
|
||||
|
||||
|
||||
#include "tribufu++/ModelBase.h"
|
||||
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
|
||||
class UserType
|
||||
: public ModelBase
|
||||
namespace tribufu
|
||||
{
|
||||
public:
|
||||
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
|
||||
namespace models
|
||||
{
|
||||
UserType_USER,
|
||||
UserType_BOT,
|
||||
};
|
||||
|
||||
eUserType getValue() const;
|
||||
void setValue(eUserType const value);
|
||||
class UserType : public ModelBase
|
||||
{
|
||||
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_ */
|
||||
|
@ -1,9 +1,12 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
$env:CPP_POST_PROCESS_FILE = "clang-format -i"
|
||||
|
||||
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
|
||||
-i https://api.tribufu.com/openapi.json `
|
||||
-g cpp-restsdk `
|
||||
-o . `
|
||||
--enable-post-process-file `
|
||||
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
|
||||
--additional-properties=packageName=tribufu++,apiPackage=tribufu.api,modelPackage=tribufu.models `
|
||||
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
|
||||
|
@ -12,38 +12,53 @@
|
||||
|
||||
#include "tribufu++/AnyType.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
namespace tribufu
|
||||
{
|
||||
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) {
|
||||
m_value = val;
|
||||
m_IsSet = true;
|
||||
return isSet();
|
||||
}
|
||||
|
||||
void AnyType::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||
const utility::string_t &prefix) const {
|
||||
if (m_value.is_object()) {
|
||||
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()) {
|
||||
return Object::fromMultiPart(multipart, prefix);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
bool AnyType::fromJson(const web::json::value &val)
|
||||
{
|
||||
m_value = val;
|
||||
m_IsSet = true;
|
||||
return isSet();
|
||||
}
|
||||
|
||||
void AnyType::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||
{
|
||||
if (m_value.is_object())
|
||||
{
|
||||
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())
|
||||
{
|
||||
return Object::fromMultiPart(multipart, prefix);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,195 +11,199 @@
|
||||
*/
|
||||
|
||||
#include "tribufu++/ApiClient.h"
|
||||
#include "tribufu++/MultipartFormData.h"
|
||||
#include "tribufu++/ModelBase.h"
|
||||
#include "tribufu++/MultipartFormData.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <limits>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
|
||||
template <typename T>
|
||||
utility::string_t toString(const T value)
|
||||
template <typename T> utility::string_t toString(const T value)
|
||||
{
|
||||
utility::ostringstream_t out;
|
||||
out << std::setprecision(std::numeric_limits<T>::digits10) << std::fixed << value;
|
||||
return out.str();
|
||||
utility::ostringstream_t out;
|
||||
out << std::setprecision(std::numeric_limits<T>::digits10) << std::fixed << value;
|
||||
return out.str();
|
||||
}
|
||||
|
||||
namespace tribufu {
|
||||
namespace api {
|
||||
|
||||
using namespace tribufu::models;
|
||||
|
||||
ApiClient::ApiClient(std::shared_ptr<const ApiConfiguration> configuration )
|
||||
: m_Configuration(configuration)
|
||||
namespace tribufu
|
||||
{
|
||||
}
|
||||
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)
|
||||
namespace api
|
||||
{
|
||||
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and form params"));
|
||||
}
|
||||
|
||||
if (postBody != nullptr && fileParams.size() != 0)
|
||||
{
|
||||
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and file params"));
|
||||
}
|
||||
using namespace tribufu::models;
|
||||
|
||||
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)
|
||||
ApiClient::ApiClient(std::shared_ptr<const ApiConfiguration> configuration) : m_Configuration(configuration)
|
||||
{
|
||||
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);
|
||||
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)
|
||||
|
||||
const ApiClient::ResponseHandlerType &ApiClient::getResponseHandler() const
|
||||
{
|
||||
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);
|
||||
return m_ResponseHandler;
|
||||
}
|
||||
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();
|
||||
for (auto& kvp : formParams)
|
||||
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and form params"));
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
web::http::uri_builder formData;
|
||||
for (const auto& kvp : formParams)
|
||||
if (postBody != nullptr)
|
||||
{
|
||||
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"
|
||||
|
||||
namespace tribufu {
|
||||
namespace api {
|
||||
|
||||
ApiConfiguration::ApiConfiguration()
|
||||
namespace tribufu
|
||||
{
|
||||
}
|
||||
|
||||
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() )
|
||||
namespace api
|
||||
{
|
||||
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"
|
||||
|
||||
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 tribufu
|
||||
{
|
||||
}
|
||||
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)
|
||||
{
|
||||
}
|
||||
namespace api
|
||||
{
|
||||
|
||||
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
|
||||
{
|
||||
return m_Content;
|
||||
}
|
||||
ApiException::~ApiException()
|
||||
{
|
||||
}
|
||||
|
||||
std::map<utility::string_t, utility::string_t>& ApiException::getHeaders()
|
||||
{
|
||||
return m_Headers;
|
||||
}
|
||||
std::shared_ptr<std::istream> ApiException::getContent() const
|
||||
{
|
||||
return m_Content;
|
||||
}
|
||||
|
||||
}
|
||||
std::map<utility::string_t, utility::string_t> &ApiException::getHeaders()
|
||||
{
|
||||
return m_Headers;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,72 +12,74 @@
|
||||
|
||||
#include "tribufu++/HttpContent.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
HttpContent::HttpContent()
|
||||
namespace tribufu
|
||||
{
|
||||
}
|
||||
namespace models
|
||||
{
|
||||
|
||||
HttpContent::~HttpContent()
|
||||
{
|
||||
}
|
||||
HttpContent::HttpContent()
|
||||
{
|
||||
}
|
||||
|
||||
utility::string_t HttpContent::getContentDisposition() const
|
||||
{
|
||||
return m_ContentDisposition;
|
||||
}
|
||||
HttpContent::~HttpContent()
|
||||
{
|
||||
}
|
||||
|
||||
void HttpContent::setContentDisposition( const utility::string_t & value )
|
||||
{
|
||||
m_ContentDisposition = value;
|
||||
}
|
||||
utility::string_t HttpContent::getContentDisposition() const
|
||||
{
|
||||
return m_ContentDisposition;
|
||||
}
|
||||
|
||||
utility::string_t HttpContent::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
void HttpContent::setContentDisposition(const utility::string_t &value)
|
||||
{
|
||||
m_ContentDisposition = value;
|
||||
}
|
||||
|
||||
void HttpContent::setName( const utility::string_t & value )
|
||||
{
|
||||
m_Name = value;
|
||||
}
|
||||
utility::string_t HttpContent::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
utility::string_t HttpContent::getFileName() const
|
||||
{
|
||||
return m_FileName;
|
||||
}
|
||||
void HttpContent::setName(const utility::string_t &value)
|
||||
{
|
||||
m_Name = value;
|
||||
}
|
||||
|
||||
void HttpContent::setFileName( const utility::string_t & value )
|
||||
{
|
||||
m_FileName = value;
|
||||
}
|
||||
utility::string_t HttpContent::getFileName() const
|
||||
{
|
||||
return m_FileName;
|
||||
}
|
||||
|
||||
utility::string_t HttpContent::getContentType() const
|
||||
{
|
||||
return m_ContentType;
|
||||
}
|
||||
void HttpContent::setFileName(const utility::string_t &value)
|
||||
{
|
||||
m_FileName = value;
|
||||
}
|
||||
|
||||
void HttpContent::setContentType( const utility::string_t & value )
|
||||
{
|
||||
m_ContentType = value;
|
||||
}
|
||||
utility::string_t HttpContent::getContentType() const
|
||||
{
|
||||
return m_ContentType;
|
||||
}
|
||||
|
||||
std::shared_ptr<std::istream> HttpContent::getData() const
|
||||
{
|
||||
return m_Data;
|
||||
}
|
||||
void HttpContent::setContentType(const utility::string_t &value)
|
||||
{
|
||||
m_ContentType = value;
|
||||
}
|
||||
|
||||
void HttpContent::setData( std::shared_ptr<std::istream> value )
|
||||
{
|
||||
m_Data = value;
|
||||
}
|
||||
std::shared_ptr<std::istream> HttpContent::getData() const
|
||||
{
|
||||
return m_Data;
|
||||
}
|
||||
|
||||
void HttpContent::writeTo( std::ostream& stream )
|
||||
{
|
||||
m_Data->seekg( 0, m_Data->beg );
|
||||
stream << m_Data->rdbuf();
|
||||
}
|
||||
void HttpContent::setData(std::shared_ptr<std::istream> value)
|
||||
{
|
||||
m_Data = value;
|
||||
}
|
||||
|
||||
}
|
||||
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"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
JsonBody::JsonBody( const web::json::value& json)
|
||||
: m_Json(json)
|
||||
namespace tribufu
|
||||
{
|
||||
}
|
||||
namespace models
|
||||
{
|
||||
|
||||
JsonBody::~JsonBody()
|
||||
{
|
||||
}
|
||||
JsonBody::JsonBody(const web::json::value &json) : m_Json(json)
|
||||
{
|
||||
}
|
||||
|
||||
void JsonBody::writeTo( std::ostream& target )
|
||||
{
|
||||
m_Json.serialize(target);
|
||||
}
|
||||
JsonBody::~JsonBody()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
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/uuid_io.hpp>
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
MultipartFormData::MultipartFormData()
|
||||
namespace tribufu
|
||||
{
|
||||
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())
|
||||
namespace models
|
||||
{
|
||||
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"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
Object::Object()
|
||||
namespace tribufu
|
||||
{
|
||||
m_object = web::json::value::object();
|
||||
}
|
||||
|
||||
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())
|
||||
namespace models
|
||||
{
|
||||
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));
|
||||
}
|
||||
Object::Object()
|
||||
{
|
||||
m_object = web::json::value::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(".");
|
||||
}
|
||||
Object::~Object()
|
||||
{
|
||||
}
|
||||
|
||||
if( ModelBase::fromHttpContent(multipart->getContent(namePrefix + utility::conversions::to_string_t("object")), m_object ) )
|
||||
{
|
||||
m_IsSet = true;
|
||||
}
|
||||
return isSet();
|
||||
}
|
||||
void Object::validate()
|
||||
{
|
||||
}
|
||||
|
||||
web::json::value Object::getValue(const utility::string_t& key) const
|
||||
{
|
||||
return m_object.at(key);
|
||||
}
|
||||
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
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/Account.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
Account::Account()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Id = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
m_Id = utility::conversions::to_string_t("");
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
Account::~Account()
|
||||
{
|
||||
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())
|
||||
|
||||
void Account::validate()
|
||||
{
|
||||
std::shared_ptr<LoginProvider> refVal_setProvider;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setProvider);
|
||||
setProvider(refVal_setProvider);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value Account::toJson() const
|
||||
{
|
||||
utility::string_t refVal_setUserId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUserId);
|
||||
setUserId(refVal_setUserId);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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 Account::fromJson(const web::json::value &val)
|
||||
{
|
||||
bool refVal_setAuthorized;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setAuthorized);
|
||||
setAuthorized(refVal_setAuthorized);
|
||||
|
||||
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())
|
||||
{
|
||||
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"))))
|
||||
{
|
||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("fields")));
|
||||
if(!fieldValue.is_null())
|
||||
|
||||
void Account::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||
{
|
||||
std::shared_ptr<AnyType> refVal_setFields;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setFields);
|
||||
setFields(refVal_setFields);
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool Account::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||
{
|
||||
utility::datetime refVal_setCreated;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCreated);
|
||||
setCreated(refVal_setCreated);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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::string_t Account::getId() const
|
||||
{
|
||||
utility::datetime refVal_setUpdated;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUpdated);
|
||||
setUpdated(refVal_setUpdated);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/ApplicationType.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/AuthorizeRequest.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
AuthorizeRequest::AuthorizeRequest()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Response_typeIsSet = false;
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setResponseType);
|
||||
setResponseType(refVal_setResponseType);
|
||||
|
||||
m_Response_typeIsSet = false;
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
AuthorizeRequest::~AuthorizeRequest()
|
||||
{
|
||||
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())
|
||||
|
||||
void AuthorizeRequest::validate()
|
||||
{
|
||||
utility::string_t refVal_setCodeChallenge;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCodeChallenge);
|
||||
setCodeChallenge(refVal_setCodeChallenge);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value AuthorizeRequest::toJson() const
|
||||
{
|
||||
std::shared_ptr<CodeChallengeMethod> refVal_setCodeChallengeMethod;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCodeChallengeMethod);
|
||||
setCodeChallengeMethod(refVal_setCodeChallengeMethod);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool AuthorizeRequest::fromJson(const web::json::value &val)
|
||||
{
|
||||
utility::string_t refVal_setRedirectUri;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRedirectUri);
|
||||
setRedirectUri(refVal_setRedirectUri);
|
||||
|
||||
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())
|
||||
{
|
||||
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"))))
|
||||
{
|
||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("scope")));
|
||||
if(!fieldValue.is_null())
|
||||
|
||||
void AuthorizeRequest::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||
const utility::string_t &prefix) const
|
||||
{
|
||||
utility::string_t refVal_setScope;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setScope);
|
||||
setScope(refVal_setScope);
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool AuthorizeRequest::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
||||
const utility::string_t &prefix)
|
||||
{
|
||||
utility::string_t refVal_setState;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setState);
|
||||
setState(refVal_setState);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/CodeChallengeMethod.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/CryptoViewModel.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
CryptoViewModel::CryptoViewModel()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Encoded = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setEncoded);
|
||||
setEncoded(refVal_setEncoded);
|
||||
|
||||
m_Encoded = utility::conversions::to_string_t("");
|
||||
m_EncodedIsSet = false;
|
||||
m_Decoded = utility::conversions::to_string_t("");
|
||||
m_DecodedIsSet = false;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
CryptoViewModel::~CryptoViewModel()
|
||||
{
|
||||
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));
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/GrantType.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/GroupGame.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
GroupGame::GroupGame()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Group_id = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setGroupId);
|
||||
setGroupId(refVal_setGroupId);
|
||||
|
||||
m_Group_id = utility::conversions::to_string_t("");
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
GroupGame::~GroupGame()
|
||||
{
|
||||
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())
|
||||
|
||||
void GroupGame::validate()
|
||||
{
|
||||
utility::string_t refVal_setApplicationId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setApplicationId);
|
||||
setApplicationId(refVal_setApplicationId);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value GroupGame::toJson() const
|
||||
{
|
||||
std::shared_ptr<Application> refVal_setApplication;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setApplication);
|
||||
setApplication(refVal_setApplication);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool GroupGame::fromJson(const web::json::value &val)
|
||||
{
|
||||
std::shared_ptr<AnyType> refVal_setStats;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setStats);
|
||||
setStats(refVal_setStats);
|
||||
|
||||
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())
|
||||
{
|
||||
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"))))
|
||||
{
|
||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("acquired")));
|
||||
if(!fieldValue.is_null())
|
||||
|
||||
void GroupGame::toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix) const
|
||||
{
|
||||
utility::datetime refVal_setAcquired;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setAcquired);
|
||||
setAcquired(refVal_setAcquired);
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool GroupGame::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||
{
|
||||
utility::datetime refVal_setLastUsed;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLastUsed);
|
||||
setLastUsed(refVal_setLastUsed);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/GroupMember.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
GroupMember::GroupMember()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Id = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
m_Id = utility::conversions::to_string_t("");
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
GroupMember::~GroupMember()
|
||||
{
|
||||
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())
|
||||
|
||||
void GroupMember::validate()
|
||||
{
|
||||
utility::string_t refVal_setName;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||
setName(refVal_setName);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value GroupMember::toJson() const
|
||||
{
|
||||
utility::string_t refVal_setDisplayName;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setDisplayName);
|
||||
setDisplayName(refVal_setDisplayName);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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 GroupMember::fromJson(const web::json::value &val)
|
||||
{
|
||||
bool refVal_setVerified;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setVerified);
|
||||
setVerified(refVal_setVerified);
|
||||
|
||||
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())
|
||||
{
|
||||
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"))))
|
||||
{
|
||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("photo_url")));
|
||||
if(!fieldValue.is_null())
|
||||
|
||||
void GroupMember::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||
const utility::string_t &prefix) const
|
||||
{
|
||||
utility::string_t refVal_setPhotoUrl;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrl);
|
||||
setPhotoUrl(refVal_setPhotoUrl);
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool GroupMember::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||
{
|
||||
utility::datetime refVal_setLastOnline;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLastOnline);
|
||||
setLastOnline(refVal_setLastOnline);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
utility::string_t GroupMember::getId() const
|
||||
{
|
||||
std::shared_ptr<GroupRank> refVal_setRank;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRank);
|
||||
setRank(refVal_setRank);
|
||||
|
||||
return m_Id;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
void GroupMember::setId(const utility::string_t &value)
|
||||
{
|
||||
utility::datetime refVal_setSince;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setSince);
|
||||
setSince(refVal_setSince);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/GroupRank.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/HashViewModel.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
HashViewModel::HashViewModel()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Value = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setValue);
|
||||
setValue(refVal_setValue);
|
||||
|
||||
m_Value = utility::conversions::to_string_t("");
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/IntrospectRequest.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
IntrospectRequest::IntrospectRequest()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Token = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setToken);
|
||||
setToken(refVal_setToken);
|
||||
|
||||
m_Token = utility::conversions::to_string_t("");
|
||||
m_TokenIsSet = false;
|
||||
m_Token_type_hintIsSet = false;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
IntrospectRequest::~IntrospectRequest()
|
||||
{
|
||||
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));
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/LeaderboardItem.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
LeaderboardItem::LeaderboardItem()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Name = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setName);
|
||||
setName(refVal_setName);
|
||||
|
||||
m_Name = utility::conversions::to_string_t("");
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
LeaderboardItem::~LeaderboardItem()
|
||||
{
|
||||
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())
|
||||
|
||||
void LeaderboardItem::validate()
|
||||
{
|
||||
utility::string_t refVal_setPhotoUrl;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrl);
|
||||
setPhotoUrl(refVal_setPhotoUrl);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value LeaderboardItem::toJson() const
|
||||
{
|
||||
int32_t refVal_setLevel;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLevel);
|
||||
setLevel(refVal_setLevel);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool LeaderboardItem::fromJson(const web::json::value &val)
|
||||
{
|
||||
double refVal_setExperience;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setExperience);
|
||||
setExperience(refVal_setExperience);
|
||||
|
||||
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())
|
||||
{
|
||||
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"))))
|
||||
{
|
||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("points")));
|
||||
if(!fieldValue.is_null())
|
||||
|
||||
void LeaderboardItem::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||
const utility::string_t &prefix) const
|
||||
{
|
||||
double refVal_setPoints;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPoints);
|
||||
setPoints(refVal_setPoints);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/LeaderboardOrder.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/LoginProvider.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/LoginRequest.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
LoginRequest::LoginRequest()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Login = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setLogin);
|
||||
setLogin(refVal_setLogin);
|
||||
|
||||
m_Login = utility::conversions::to_string_t("");
|
||||
m_LoginIsSet = false;
|
||||
m_Password = utility::conversions::to_string_t("");
|
||||
m_PasswordIsSet = false;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
LoginRequest::~LoginRequest()
|
||||
{
|
||||
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));
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/LoginResponse.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
LoginResponse::LoginResponse()
|
||||
namespace tribufu
|
||||
{
|
||||
m_UserIsSet = false;
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUser);
|
||||
setUser(refVal_setUser);
|
||||
|
||||
m_UserIsSet = false;
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
LoginResponse::~LoginResponse()
|
||||
{
|
||||
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())
|
||||
|
||||
void LoginResponse::validate()
|
||||
{
|
||||
utility::string_t refVal_setRefreshToken;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRefreshToken);
|
||||
setRefreshToken(refVal_setRefreshToken);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value LoginResponse::toJson() const
|
||||
{
|
||||
int64_t refVal_setExpiresIn;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setExpiresIn);
|
||||
setExpiresIn(refVal_setExpiresIn);
|
||||
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/RefreshRequest.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
RefreshRequest::RefreshRequest()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Refresh_token = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setRefreshToken);
|
||||
setRefreshToken(refVal_setRefreshToken);
|
||||
|
||||
m_Refresh_token = utility::conversions::to_string_t("");
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/RegisterRequest.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
RegisterRequest::RegisterRequest()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Uuid = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUuid);
|
||||
setUuid(refVal_setUuid);
|
||||
|
||||
m_Uuid = utility::conversions::to_string_t("");
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
RegisterRequest::~RegisterRequest()
|
||||
{
|
||||
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())
|
||||
|
||||
void RegisterRequest::validate()
|
||||
{
|
||||
utility::string_t refVal_setEmail;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setEmail);
|
||||
setEmail(refVal_setEmail);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value RegisterRequest::toJson() const
|
||||
{
|
||||
utility::string_t refVal_setPassword;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
|
||||
setPassword(refVal_setPassword);
|
||||
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/ResponseType.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/RevokeRequest.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
RevokeRequest::RevokeRequest()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Token = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setToken);
|
||||
setToken(refVal_setToken);
|
||||
|
||||
m_Token = utility::conversions::to_string_t("");
|
||||
m_TokenIsSet = false;
|
||||
m_Token_type_hintIsSet = false;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
RevokeRequest::~RevokeRequest()
|
||||
{
|
||||
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));
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/SearchRequest.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
SearchRequest::SearchRequest()
|
||||
namespace tribufu
|
||||
{
|
||||
m_TypeIsSet = false;
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setType);
|
||||
setType(refVal_setType);
|
||||
|
||||
m_TypeIsSet = false;
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
SearchRequest::~SearchRequest()
|
||||
{
|
||||
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())
|
||||
|
||||
void SearchRequest::validate()
|
||||
{
|
||||
int32_t refVal_setPage;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPage);
|
||||
setPage(refVal_setPage);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value SearchRequest::toJson() const
|
||||
{
|
||||
utility::string_t refVal_setGameId;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setGameId);
|
||||
setGameId(refVal_setGameId);
|
||||
|
||||
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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/SearchType.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/ServerMetrics.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
ServerMetrics::ServerMetrics()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Server_count = 0;
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setServerCount);
|
||||
setServerCount(refVal_setServerCount);
|
||||
|
||||
m_Server_count = 0;
|
||||
m_Server_countIsSet = false;
|
||||
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"))))
|
||||
{
|
||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("package_count")));
|
||||
if(!fieldValue.is_null())
|
||||
|
||||
ServerMetrics::~ServerMetrics()
|
||||
{
|
||||
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())
|
||||
|
||||
void ServerMetrics::validate()
|
||||
{
|
||||
int32_t refVal_setCountryCount;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCountryCount);
|
||||
setCountryCount(refVal_setCountryCount);
|
||||
|
||||
// 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())
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/ServerStatus.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/Subscription.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
Subscription::Subscription()
|
||||
namespace tribufu
|
||||
{
|
||||
m_Id = utility::conversions::to_string_t("");
|
||||
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"))))
|
||||
namespace models
|
||||
{
|
||||
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;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setId);
|
||||
setId(refVal_setId);
|
||||
|
||||
m_Id = utility::conversions::to_string_t("");
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
Subscription::~Subscription()
|
||||
{
|
||||
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())
|
||||
|
||||
void Subscription::validate()
|
||||
{
|
||||
utility::string_t refVal_setDescription;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setDescription);
|
||||
setDescription(refVal_setDescription);
|
||||
|
||||
// TODO: implement validation
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
web::json::value Subscription::toJson() const
|
||||
{
|
||||
utility::string_t refVal_setImageUrl;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setImageUrl);
|
||||
setImageUrl(refVal_setImageUrl);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool Subscription::fromJson(const web::json::value &val)
|
||||
{
|
||||
std::map<utility::string_t, double> refVal_setPrices;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setPrices);
|
||||
setPrices(refVal_setPrices);
|
||||
|
||||
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())
|
||||
{
|
||||
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"))))
|
||||
{
|
||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("created")));
|
||||
if(!fieldValue.is_null())
|
||||
|
||||
void Subscription::toMultipart(std::shared_ptr<MultipartFormData> multipart,
|
||||
const utility::string_t &prefix) const
|
||||
{
|
||||
utility::datetime refVal_setCreated;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setCreated);
|
||||
setCreated(refVal_setCreated);
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
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())
|
||||
|
||||
bool Subscription::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t &prefix)
|
||||
{
|
||||
utility::datetime refVal_setUpdated;
|
||||
ok &= ModelBase::fromJson(fieldValue, refVal_setUpdated);
|
||||
setUpdated(refVal_setUpdated);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "tribufu++/model/TokenHintType.h"
|
||||
|
||||
namespace tribufu {
|
||||
namespace models {
|
||||
|
||||
namespace
|
||||
namespace tribufu
|
||||
{
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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)
|
||||
namespace models
|
||||
{
|
||||
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)
|
||||
namespace
|
||||
{
|
||||
auto v = toEnum(e);
|
||||
setValue(v);
|
||||
using EnumUnderlyingType = utility::string_t;
|
||||
|
||||
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