Generate project with openapi generator

This commit is contained in:
2025-05-28 13:56:37 -03:00
parent 79bfdecaf8
commit d3fb88a65d
116 changed files with 36001 additions and 184 deletions

1
.gitattributes vendored
View File

@ -1 +1,2 @@
* text=auto eol=lf
vendor/** linguist-vendored

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
.vscode/
bin/
target/
vendor/
.DS_Store
.env

View File

@ -1,5 +1,7 @@
docs/
.gitignore
CMakeLists.txt
Config.cmake.in
git_push.sh
README.md

View File

@ -1,58 +1,56 @@
CMakeLists.txt
Config.cmake.in
include/tribufu/AnyType.h
include/tribufu/ApiClient.h
include/tribufu/ApiConfiguration.h
include/tribufu/ApiException.h
include/tribufu/HttpContent.h
include/tribufu/IHttpBody.h
include/tribufu/JsonBody.h
include/tribufu/ModelBase.h
include/tribufu/MultipartFormData.h
include/tribufu/Object.h
include/tribufu/api/TribufuGeneratedApi.h
include/tribufu/model/Account.h
include/tribufu/model/Application.h
include/tribufu/model/ApplicationType.h
include/tribufu/model/AuthorizeRequest.h
include/tribufu/model/CodeChallengeMethod.h
include/tribufu/model/CryptoViewModel.h
include/tribufu/model/Game.h
include/tribufu/model/GameServer.h
include/tribufu/model/GameServerCluster.h
include/tribufu/model/GrantType.h
include/tribufu/model/Group.h
include/tribufu/model/GroupGame.h
include/tribufu/model/GroupMember.h
include/tribufu/model/GroupRank.h
include/tribufu/model/HashViewModel.h
include/tribufu/model/IntrospectRequest.h
include/tribufu/model/IpAddress.h
include/tribufu/model/LeaderboardItem.h
include/tribufu/model/LeaderboardOrder.h
include/tribufu/model/LoginProvider.h
include/tribufu/model/LoginRequest.h
include/tribufu/model/LoginResponse.h
include/tribufu/model/Package.h
include/tribufu/model/Profile.h
include/tribufu/model/ProfileGame.h
include/tribufu/model/ProfileGroup.h
include/tribufu/model/RefreshRequest.h
include/tribufu/model/RegisterRequest.h
include/tribufu/model/ResponseType.h
include/tribufu/model/RevokeRequest.h
include/tribufu/model/SearchRequest.h
include/tribufu/model/SearchType.h
include/tribufu/model/ServerMetrics.h
include/tribufu/model/ServerStatus.h
include/tribufu/model/Subscription.h
include/tribufu/model/TokenHintType.h
include/tribufu/model/TokenRequest.h
include/tribufu/model/TokenResponse.h
include/tribufu/model/TokenType.h
include/tribufu/model/UpdateProfile.h
include/tribufu/model/UserInfo.h
include/tribufu/model/UserType.h
include/tribufu++/AnyType.h
include/tribufu++/ApiClient.h
include/tribufu++/ApiConfiguration.h
include/tribufu++/ApiException.h
include/tribufu++/HttpContent.h
include/tribufu++/IHttpBody.h
include/tribufu++/JsonBody.h
include/tribufu++/ModelBase.h
include/tribufu++/MultipartFormData.h
include/tribufu++/Object.h
include/tribufu++/api/TribufuGeneratedApi.h
include/tribufu++/model/Account.h
include/tribufu++/model/Application.h
include/tribufu++/model/ApplicationType.h
include/tribufu++/model/AuthorizeRequest.h
include/tribufu++/model/CodeChallengeMethod.h
include/tribufu++/model/CryptoViewModel.h
include/tribufu++/model/Game.h
include/tribufu++/model/GameServer.h
include/tribufu++/model/GameServerCluster.h
include/tribufu++/model/GrantType.h
include/tribufu++/model/Group.h
include/tribufu++/model/GroupGame.h
include/tribufu++/model/GroupMember.h
include/tribufu++/model/GroupRank.h
include/tribufu++/model/HashViewModel.h
include/tribufu++/model/IntrospectRequest.h
include/tribufu++/model/IpAddress.h
include/tribufu++/model/LeaderboardItem.h
include/tribufu++/model/LeaderboardOrder.h
include/tribufu++/model/LoginProvider.h
include/tribufu++/model/LoginRequest.h
include/tribufu++/model/LoginResponse.h
include/tribufu++/model/Package.h
include/tribufu++/model/Profile.h
include/tribufu++/model/ProfileGame.h
include/tribufu++/model/ProfileGroup.h
include/tribufu++/model/RefreshRequest.h
include/tribufu++/model/RegisterRequest.h
include/tribufu++/model/ResponseType.h
include/tribufu++/model/RevokeRequest.h
include/tribufu++/model/SearchRequest.h
include/tribufu++/model/SearchType.h
include/tribufu++/model/ServerMetrics.h
include/tribufu++/model/ServerStatus.h
include/tribufu++/model/Subscription.h
include/tribufu++/model/TokenHintType.h
include/tribufu++/model/TokenRequest.h
include/tribufu++/model/TokenResponse.h
include/tribufu++/model/TokenType.h
include/tribufu++/model/UpdateProfile.h
include/tribufu++/model/UserInfo.h
include/tribufu++/model/UserType.h
src/AnyType.cpp
src/ApiClient.cpp
src/ApiConfiguration.cpp

View File

@ -1,104 +0,0 @@
#
# Tribufu API
# REST API to access Tribufu services.
#
# The version of the OpenAPI document: 1.0.0
#
# https://openapi-generator.tech
#
# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
cmake_minimum_required (VERSION 3.5)
project(tribufu CXX)
# Force -fPIC even if the project is configured for building a static library.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_CXX_STANDARD)
if(DEFINED CMAKE_CXX20_STANDARD_COMPILE_OPTION OR
DEFINED CMAKE_CXX20_EXTENSION_COMPILE_OPTION)
set(CMAKE_CXX_STANDARD 20)
elseif(DEFINED CMAKE_CXX17_STANDARD_COMPILE_OPTION OR
DEFINED CMAKE_CXX17_EXTENSION_COMPILE_OPTION)
set(CMAKE_CXX_STANDARD 17)
elseif(DEFINED CMAKE_CXX14_STANDARD_COMPILE_OPTION OR
DEFINED CMAKE_CXX14_EXTENSION_COMPILE_OPTION)
set(CMAKE_CXX_STANDARD 14)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
find_package(cpprestsdk REQUIRED)
find_package(Boost REQUIRED)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
file(GLOB_RECURSE HEADER_FILES "include/*.h")
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp")
add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES})
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wno-unused-variable -Wno-unused-lambda-capture>
)
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if (UNIX)
message(STATUS "Building client library for Linux/Unix")
if (BUILD_SHARED_LIBS)
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest)
else()
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest crypto)
endif()
else()
message(STATUS "Building client library for Windows")
if (BUILD_SHARED_LIBS)
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest)
else()
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::headers cpprestsdk::cpprest bcrypt)
endif()
endif()
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
install(
EXPORT ${PROJECT_NAME}Targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)

View File

@ -1,5 +0,0 @@
@PACKAGE_INIT@
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake)
check_required_components("@PROJECT_NAME@")

View File

@ -1,5 +1,8 @@
#!/usr/bin/env pwsh
$env:VCPKG_ROOT = "D:\Program Files\vcpkg"
$env:PATH = "$env:VCPKG_ROOT;$env:PATH"
git submodule update --init --recursive
if ($IsWindows)

View File

@ -0,0 +1,55 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AnyType.h
*
* This is the implementation of an any JSON type.
*/
#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 {
class AnyType : public Object {
public:
AnyType();
virtual ~AnyType();
/////////////////////////////////////////////
/// 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;
private:
web::json::value m_value;
};
}
}
#endif /* TRIBUFU_MODELS_AnyType_H_ */

View File

@ -0,0 +1,111 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApiClient.h
*
* This is an API client responsible for stating the HTTP calls
*/
#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"
#if defined (_WIN32) || defined (_WIN64)
#undef U
#endif
#include <cpprest/details/basic_types.h>
#include <cpprest/http_client.h>
#include <memory>
#include <vector>
#include <functional>
namespace tribufu {
namespace api {
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());
}
}
}
#endif /* TRIBUFU_API_ApiClient_H_ */

View File

@ -0,0 +1,63 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApiConfiguration.h
*
* This class represents a single item of a multipart-formdata request.
*/
#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
{
public:
ApiConfiguration();
virtual ~ApiConfiguration();
const web::http::client::http_client_config& getHttpConfig() const;
void setHttpConfig( web::http::client::http_client_config& value );
utility::string_t getBaseUrl() const;
void setBaseUrl( const utility::string_t value );
utility::string_t getUserAgent() const;
void setUserAgent( 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 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_ */

View File

@ -0,0 +1,57 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApiException.h
*
* This is the exception being thrown in case the api call was not successful
*/
#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>
namespace tribufu {
namespace api {
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();
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_ */

View File

@ -0,0 +1,66 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* HttpContent.h
*
* This class represents a single item of a multipart-formdata request.
*/
#ifndef TRIBUFU_MODELS_HttpContent_H_
#define TRIBUFU_MODELS_HttpContent_H_
#include <cpprest/details/basic_types.h>
#include <memory>
namespace tribufu {
namespace models {
class HttpContent
{
public:
HttpContent();
virtual ~HttpContent();
virtual utility::string_t getContentDisposition() const;
virtual void setContentDisposition( const utility::string_t& value );
virtual utility::string_t getName() const;
virtual void setName( const utility::string_t& value );
virtual utility::string_t getFileName() const;
virtual void setFileName( const utility::string_t& value );
virtual utility::string_t getContentType() const;
virtual void setContentType( const utility::string_t& value );
virtual std::shared_ptr<std::istream> getData() const;
virtual void setData( std::shared_ptr<std::istream> value );
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_ */

View File

@ -0,0 +1,39 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* IHttpBody.h
*
* This is the interface for contents that can be sent to a remote HTTP server.
*/
#ifndef TRIBUFU_MODELS_IHttpBody_H_
#define TRIBUFU_MODELS_IHttpBody_H_
#include <iostream>
namespace tribufu {
namespace models {
class IHttpBody
{
public:
virtual ~IHttpBody() { }
virtual void writeTo( std::ostream& stream ) = 0;
};
}
}
#endif /* TRIBUFU_MODELS_IHttpBody_H_ */

View File

@ -0,0 +1,46 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* JsonBody.h
*
* This is a JSON http body which can be submitted via http
*/
#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
{
public:
JsonBody( const web::json::value& value );
virtual ~JsonBody();
void writeTo( std::ostream& target ) override;
protected:
web::json::value m_Json;
};
}
}
#endif /* TRIBUFU_MODELS_JsonBody_H_ */

View File

@ -0,0 +1,502 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ModelBase.h
*
* This is the base class for all model classes
*/
#ifndef TRIBUFU_MODELS_ModelBase_H_
#define TRIBUFU_MODELS_ModelBase_H_
#include "tribufu++/HttpContent.h"
#include "tribufu++/MultipartFormData.h"
#include <cpprest/details/basic_types.h>
#include <cpprest/json.h>
#include <map>
#include <set>
#include <vector>
namespace tribufu {
namespace models {
class ModelBase
{
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);
}
}
}
#endif /* TRIBUFU_MODELS_ModelBase_H_ */

View File

@ -0,0 +1,58 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* MultipartFormData.h
*
* This class represents a container for building application/x-multipart-formdata requests.
*/
#ifndef TRIBUFU_MODELS_MultipartFormData_H_
#define TRIBUFU_MODELS_MultipartFormData_H_
#include "tribufu++/IHttpBody.h"
#include "tribufu++/HttpContent.h"
#include <cpprest/details/basic_types.h>
#include <vector>
#include <map>
#include <memory>
namespace tribufu {
namespace models {
class MultipartFormData
: public IHttpBody
{
public:
MultipartFormData();
MultipartFormData(const utility::string_t& boundary);
virtual ~MultipartFormData();
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_ */

View File

@ -0,0 +1,59 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Object.h
*
* This is the implementation of a JSON object.
*/
#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
{
public:
Object();
virtual ~Object();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// 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_ */

View File

@ -0,0 +1,844 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* TribufuGeneratedApi.h
*
*
*/
#ifndef TRIBUFU_API_TribufuGeneratedApi_H_
#define TRIBUFU_API_TribufuGeneratedApi_H_
#include "tribufu++/ApiClient.h"
#include "tribufu++/model/Account.h"
#include "tribufu++/AnyType.h"
#include "tribufu++/model/AuthorizeRequest.h"
#include "tribufu++/model/CryptoViewModel.h"
#include "tribufu++/model/Game.h"
#include "tribufu++/model/GameServer.h"
#include "tribufu++/model/GameServerCluster.h"
#include "tribufu++/model/Group.h"
#include "tribufu++/model/GroupGame.h"
#include "tribufu++/model/GroupMember.h"
#include "tribufu++/model/HashViewModel.h"
#include "tribufu++/model/IntrospectRequest.h"
#include "tribufu++/model/IpAddress.h"
#include "tribufu++/model/LeaderboardItem.h"
#include "tribufu++/model/LeaderboardOrder.h"
#include "tribufu++/model/LoginRequest.h"
#include "tribufu++/model/LoginResponse.h"
#include "tribufu++/model/Package.h"
#include "tribufu++/model/Profile.h"
#include "tribufu++/model/ProfileGame.h"
#include "tribufu++/model/ProfileGroup.h"
#include "tribufu++/model/RefreshRequest.h"
#include "tribufu++/model/RegisterRequest.h"
#include "tribufu++/model/RevokeRequest.h"
#include "tribufu++/model/SearchRequest.h"
#include "tribufu++/model/ServerMetrics.h"
#include "tribufu++/model/Subscription.h"
#include "tribufu++/model/TokenRequest.h"
#include "tribufu++/model/TokenResponse.h"
#include "tribufu++/model/UpdateProfile.h"
#include "tribufu++/model/UserInfo.h"
#include <map>
#include <vector>
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace tribufu {
namespace api {
using namespace tribufu::models;
class TribufuGeneratedApi
{
public:
explicit TribufuGeneratedApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~TribufuGeneratedApi();
/// <summary>
/// Authorize the client to access the user information.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.oauth2.authorize&lt;/code&gt;
/// </remarks>
/// <param name="authorizeRequest"> (optional)</param>
pplx::task<void> authorize(
boost::optional<std::shared_ptr<AuthorizeRequest>> authorizeRequest
) const;
/// <summary>
/// Change the email of a user.
/// </summary>
/// <remarks>
/// This endpoint is not available with an api key, only with a bearer token.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.user.email.update&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="body"> (optional)</param>
pplx::task<void> changeEmail(
utility::string_t id,
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Change the password of a user.
/// </summary>
/// <remarks>
/// This endpoint is not available with an api key, only with a bearer token.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.user.password.update&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="body"> (optional)</param>
pplx::task<void> changePassword(
utility::string_t id,
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Claim a game server.
/// </summary>
/// <remarks>
/// This endpoint is not available with an api key, only with a bearer token.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.claim&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="body"> (optional)</param>
pplx::task<void> claimGameServer(
utility::string_t id,
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Convert a string to base64 or vice versa.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.convert.base64&lt;/code&gt;
/// </remarks>
/// <param name="cryptoViewModel"> (optional)</param>
pplx::task<std::shared_ptr<CryptoViewModel>> convertBase64(
boost::optional<std::shared_ptr<CryptoViewModel>> cryptoViewModel
) const;
/// <summary>
/// Create a new game server.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.create&lt;/code&gt;
/// </remarks>
/// <param name="body"> (optional)</param>
pplx::task<void> createGameServer(
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Create a new game server cluster.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.cluster.create&lt;/code&gt;
/// </remarks>
/// <param name="body"> (optional)</param>
pplx::task<void> createGameServerCluster(
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Create a new group.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.create&lt;/code&gt;
/// </remarks>
/// <param name="body"> (optional)</param>
pplx::task<void> createGroup(
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Create a new token with grant type.
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="tokenRequest"> (optional)</param>
pplx::task<std::shared_ptr<TokenResponse>> createToken(
boost::optional<std::shared_ptr<TokenRequest>> tokenRequest
) const;
/// <summary>
/// Delete a game server.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.delete&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<void> deleteGameServer(
utility::string_t id
) const;
/// <summary>
/// Delete a game server cluster.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.cluster.delete&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<void> deleteGameServerCluster(
utility::string_t id
) const;
/// <summary>
/// Delete a group.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.delete&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<void> deleteGroup(
utility::string_t id
) const;
/// <summary>
/// Generate one or more flake ids.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.generate.flake&lt;/code&gt;
/// </remarks>
/// <param name="amount"> (optional, default to 0)</param>
pplx::task<std::vector<utility::string_t>> generateFlakeId(
boost::optional<int32_t> amount
) const;
/// <summary>
/// Generate one or more flake ids from a timestamp.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.generate.flake.timestamp&lt;/code&gt;
/// </remarks>
/// <param name="timestamp"></param>
/// <param name="amount"> (optional, default to 0)</param>
pplx::task<std::vector<utility::string_t>> generateFlakeIdFromTimestamp(
utility::string_t timestamp,
boost::optional<int32_t> amount
) const;
/// <summary>
/// Generate a random password.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.generate.password&lt;/code&gt;
/// </remarks>
/// <param name="length"> (optional, default to 0)</param>
/// <param name="symbols"> (optional, default to false)</param>
pplx::task<std::shared_ptr<HashViewModel>> generatePassword(
boost::optional<int32_t> length,
boost::optional<bool> symbols
) const;
/// <summary>
/// Generate one or more uuids with a specific version.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.generate.uuid&lt;/code&gt;
/// </remarks>
/// <param name="version"> (optional, default to 0)</param>
/// <param name="amount"> (optional, default to 0)</param>
pplx::task<std::vector<utility::string_t>> generateUuid(
boost::optional<int32_t> version,
boost::optional<int32_t> amount
) const;
/// <summary>
/// Get current client information.
/// </summary>
/// <remarks>
///
/// </remarks>
pplx::task<void> getClientInfo(
) const;
/// <summary>
/// Get current ip address location.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.geoip.current&lt;/code&gt;
/// </remarks>
pplx::task<std::vector<std::shared_ptr<IpAddress>>> getCurrentIpAddress(
) const;
/// <summary>
/// Get a game by id.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.get&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::shared_ptr<Game>> getGameById(
utility::string_t id
) const;
/// <summary>
/// Get a list of game server clusters of a game.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.cluster.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<GameServerCluster>>> getGameClustersByGameId(
utility::string_t id,
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a list of game items.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.item.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<AnyType>>> getGameItems(
utility::string_t id,
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a game server by address and query port.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.get.address&lt;/code&gt;
/// </remarks>
/// <param name="address"></param>
/// <param name="port"></param>
pplx::task<std::shared_ptr<GameServer>> getGameServerByAddressAndQueryPort(
utility::string_t address,
int32_t port
) const;
/// <summary>
/// Get a game server by id.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.get&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::shared_ptr<GameServer>> getGameServerById(
utility::string_t id
) const;
/// <summary>
/// Get a game server cluster by id.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.cluster.get&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::shared_ptr<GameServerCluster>> getGameServerClusterById(
utility::string_t id
) const;
/// <summary>
/// Get a list of game server clusters.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.cluster.list&lt;/code&gt;
/// </remarks>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<GameServerCluster>>> getGameServerClusters(
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a list of game servers.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.list&lt;/code&gt;
/// </remarks>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<GameServer>>> getGameServers(
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a list of game servers from a country.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.list.country&lt;/code&gt;
/// </remarks>
/// <param name="country"></param>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<GameServer>>> getGameServersByCountry(
utility::string_t country,
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a list of game servers of a game.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<GameServer>>> getGameServersByGameId(
utility::string_t id,
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a list of countries with the number of game servers.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.country.list&lt;/code&gt;
/// </remarks>
pplx::task<std::map<utility::string_t, int32_t>> getGameServersCountries(
) const;
/// <summary>
/// Get metrics about the tracked game servers.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.metric.get&lt;/code&gt;
/// </remarks>
pplx::task<std::shared_ptr<ServerMetrics>> getGameServersMetrics(
) const;
/// <summary>
/// Get a list of games.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.list&lt;/code&gt;
/// </remarks>
pplx::task<std::vector<std::shared_ptr<Game>>> getGames(
) const;
/// <summary>
/// Get a group by id.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.get&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::shared_ptr<Group>> getGroupById(
utility::string_t id
) const;
/// <summary>
/// Get a group by tag.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.get.tag&lt;/code&gt;
/// </remarks>
/// <param name="tag"></param>
pplx::task<std::shared_ptr<Group>> getGroupByTag(
utility::string_t tag
) const;
/// <summary>
/// Get a group by uuid.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.get.uuid&lt;/code&gt;
/// </remarks>
/// <param name="uuid"></param>
pplx::task<std::shared_ptr<Group>> getGroupByUuid(
utility::string_t uuid
) const;
/// <summary>
/// Get a list of games of a group.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.game.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::vector<std::shared_ptr<GroupGame>>> getGroupGames(
utility::string_t id
) const;
/// <summary>
/// Get a list of members in a group.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.member.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::vector<std::shared_ptr<GroupMember>>> getGroupMembers(
utility::string_t id
) const;
/// <summary>
/// Get a list of groups.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.list&lt;/code&gt;
/// </remarks>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<Group>>> getGroups(
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a ip address location.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.geoip.address.get&lt;/code&gt;
/// </remarks>
/// <param name="address"></param>
pplx::task<std::shared_ptr<IpAddress>> getIpAddress(
utility::string_t address
) const;
/// <summary>
/// Get a list of ip addresses.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.geoip.address.list&lt;/code&gt;
/// </remarks>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<IpAddress>>> getIpAddresses(
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get the top 20 leaderboard users.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.leaderboard.get&lt;/code&gt;
/// </remarks>
/// <param name="order"> (optional, default to new LeaderboardOrder())</param>
pplx::task<std::vector<std::shared_ptr<LeaderboardItem>>> getLeaderboard(
boost::optional<std::shared_ptr<LeaderboardOrder>> order
) const;
/// <summary>
/// Get current user information.
/// </summary>
/// <remarks>
///
/// </remarks>
pplx::task<std::shared_ptr<UserInfo>> getMe(
) const;
/// <summary>
/// Get a package by id.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.package.get&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::shared_ptr<Package>> getPackageById(
utility::string_t id
) const;
/// <summary>
/// Get a list of packages.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.package.list&lt;/code&gt;
/// </remarks>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<Package>>> getPackages(
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get the public keys for the client.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.oauth2.client.keys&lt;/code&gt;
/// </remarks>
pplx::task<void> getPublicKeys(
) const;
/// <summary>
/// Get a subscription by id.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.store.subscription.get&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::shared_ptr<Subscription>> getSubscriptionById(
utility::string_t id
) const;
/// <summary>
/// Get a list of subscriptions.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.store.subscription.list&lt;/code&gt;
/// </remarks>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<Subscription>>> getSubscriptions(
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a list of connected accounts of the user.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.user.account.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::vector<std::shared_ptr<Account>>> getUserAccounts(
utility::string_t id
) const;
/// <summary>
/// Get a user profile by id.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.get&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::shared_ptr<Profile>> getUserById(
utility::string_t id
) const;
/// <summary>
/// Get a user profile by name.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.get.name&lt;/code&gt;
/// </remarks>
/// <param name="name"></param>
pplx::task<std::shared_ptr<Profile>> getUserByName(
utility::string_t name
) const;
/// <summary>
/// Get a user profile by uuid.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.get.uuid&lt;/code&gt;
/// </remarks>
/// <param name="uuid"></param>
pplx::task<std::shared_ptr<Profile>> getUserByUuid(
utility::string_t uuid
) const;
/// <summary>
/// Get a list of friends of the user.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.friend.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::vector<std::shared_ptr<AnyType>>> getUserFriends(
utility::string_t id
) const;
/// <summary>
/// Get a list of games the user has played.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.game.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::vector<std::shared_ptr<ProfileGame>>> getUserGames(
utility::string_t id
) const;
/// <summary>
/// Get a list of groups the user is a member of.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.group.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::vector<std::shared_ptr<ProfileGroup>>> getUserGroups(
utility::string_t id
) const;
/// <summary>
/// Get current user information.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.oauth2.user.info&lt;/code&gt;
/// </remarks>
pplx::task<std::shared_ptr<UserInfo>> getUserInfo(
) const;
/// <summary>
/// Get a list of punishments the user has received.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.punishment.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
pplx::task<std::vector<std::shared_ptr<AnyType>>> getUserPunishments(
utility::string_t id
) const;
/// <summary>
/// Get a list of servers the user is owner of.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.game.server.list&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<GameServer>>> getUserServers(
utility::string_t id,
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Get a list of user profiles.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.list&lt;/code&gt;
/// </remarks>
/// <param name="page"> (optional, default to 0)</param>
/// <param name="limit"> (optional, default to 0)</param>
pplx::task<std::vector<std::shared_ptr<Profile>>> getUsers(
boost::optional<int32_t> page,
boost::optional<int32_t> limit
) const;
/// <summary>
/// Hash a string using argon2.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.hash.argon2&lt;/code&gt;
/// </remarks>
/// <param name="hashViewModel"> (optional)</param>
pplx::task<std::shared_ptr<HashViewModel>> hashArgon2(
boost::optional<std::shared_ptr<HashViewModel>> hashViewModel
) const;
/// <summary>
/// Hash a string using bcrypt.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.hash.bcrypt&lt;/code&gt;
/// </remarks>
/// <param name="hashViewModel"> (optional)</param>
pplx::task<std::shared_ptr<HashViewModel>> hashBcrypt(
boost::optional<std::shared_ptr<HashViewModel>> hashViewModel
) const;
/// <summary>
/// Hash a string using md5.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.hash.md5&lt;/code&gt;
/// </remarks>
/// <param name="hashViewModel"> (optional)</param>
pplx::task<std::shared_ptr<HashViewModel>> hashMd5(
boost::optional<std::shared_ptr<HashViewModel>> hashViewModel
) const;
/// <summary>
/// Hash a string using sha256.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.utils.hash.sha256&lt;/code&gt;
/// </remarks>
/// <param name="hashViewModel"> (optional)</param>
pplx::task<std::shared_ptr<HashViewModel>> hashSha256(
boost::optional<std::shared_ptr<HashViewModel>> hashViewModel
) const;
/// <summary>
/// Introspect a token.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.oauth2.token.introspect&lt;/code&gt;
/// </remarks>
/// <param name="introspectRequest"> (optional)</param>
pplx::task<void> introspectToken(
boost::optional<std::shared_ptr<IntrospectRequest>> introspectRequest
) const;
/// <summary>
/// Login with name or email and password.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.token.create&lt;/code&gt;
/// </remarks>
/// <param name="loginRequest"> (optional)</param>
pplx::task<std::shared_ptr<LoginResponse>> login(
boost::optional<std::shared_ptr<LoginRequest>> loginRequest
) const;
/// <summary>
/// Invalidate credentials.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.token.revoke&lt;/code&gt;
/// </remarks>
pplx::task<void> logout(
) const;
/// <summary>
/// Create a new user.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.user.create&lt;/code&gt;
/// </remarks>
/// <param name="registerRequest"> (optional)</param>
pplx::task<std::shared_ptr<LoginResponse>> r_register(
boost::optional<std::shared_ptr<RegisterRequest>> registerRequest
) const;
/// <summary>
/// Refresh credentials.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.token.refresh&lt;/code&gt;
/// </remarks>
/// <param name="refreshRequest"> (optional)</param>
pplx::task<std::shared_ptr<LoginResponse>> refresh(
boost::optional<std::shared_ptr<RefreshRequest>> refreshRequest
) const;
/// <summary>
/// Revoke a token.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.identity.oauth2.token.revoke&lt;/code&gt;
/// </remarks>
/// <param name="revokeRequest"> (optional)</param>
pplx::task<void> revokeToken(
boost::optional<std::shared_ptr<RevokeRequest>> revokeRequest
) const;
/// <summary>
/// Advanced search for servers or players.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.search&lt;/code&gt;
/// </remarks>
/// <param name="searchRequest"> (optional)</param>
pplx::task<std::vector<std::shared_ptr<AnyType>>> search(
boost::optional<std::shared_ptr<SearchRequest>> searchRequest
) const;
/// <summary>
/// Update a game server.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.update&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="body"> (optional)</param>
pplx::task<void> updateGameServer(
utility::string_t id,
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Update a game server cluster.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.game.server.cluster.update&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="body"> (optional)</param>
pplx::task<void> updateGameServerCluster(
utility::string_t id,
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Update a group.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.group.update&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="body"> (optional)</param>
pplx::task<void> updateGroup(
utility::string_t id,
boost::optional<std::shared_ptr<AnyType>> body
) const;
/// <summary>
/// Update a user profile.
/// </summary>
/// <remarks>
/// &lt;b&gt;🔒 Required permissions:&lt;/b&gt; &lt;code&gt;tribufu.community.profile.update&lt;/code&gt;
/// </remarks>
/// <param name="id"></param>
/// <param name="updateProfile"> (optional)</param>
pplx::task<std::shared_ptr<Profile>> updateUserProfile(
utility::string_t id,
boost::optional<std::shared_ptr<UpdateProfile>> updateProfile
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* TRIBUFU_API_TribufuGeneratedApi_H_ */

View File

@ -0,0 +1,130 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Account.h
*
*
*/
#ifndef TRIBUFU_MODELS_Account_H_
#define TRIBUFU_MODELS_Account_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/AnyType.h"
#include "tribufu++/model/LoginProvider.h"
namespace tribufu {
namespace models {
class Account
: public ModelBase
{
public:
Account();
virtual ~Account();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// Account 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);
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);
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);
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);
protected:
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
std::shared_ptr<LoginProvider> m_Provider;
bool m_ProviderIsSet;
utility::string_t m_User_id;
bool m_User_idIsSet;
bool m_Authorized;
bool m_AuthorizedIsSet;
std::shared_ptr<AnyType> m_Fields;
bool m_FieldsIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_Account_H_ */

View File

@ -0,0 +1,225 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Application.h
*
*
*/
#ifndef TRIBUFU_MODELS_Application_H_
#define TRIBUFU_MODELS_Application_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/ApplicationType.h"
namespace tribufu {
namespace models {
class Application
: public ModelBase
{
public:
Application();
virtual ~Application();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// Application 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);
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 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 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);
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);
protected:
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Description;
bool m_DescriptionIsSet;
std::shared_ptr<ApplicationType> m_Type;
bool m_TypeIsSet;
utility::string_t m_Organization_id;
bool m_Organization_idIsSet;
utility::string_t m_Icon_url;
bool m_Icon_urlIsSet;
utility::string_t m_Banner_url;
bool m_Banner_urlIsSet;
utility::string_t m_Capsule_image_url;
bool m_Capsule_image_urlIsSet;
utility::string_t m_Library_image_url;
bool m_Library_image_urlIsSet;
utility::string_t m_Parent_id;
bool m_Parent_idIsSet;
utility::string_t m_Slug;
bool m_SlugIsSet;
int32_t m_Visibility;
bool m_VisibilityIsSet;
utility::string_t m_Password;
bool m_PasswordIsSet;
int32_t m_Primary;
bool m_PrimaryIsSet;
int32_t m_User_count;
bool m_User_countIsSet;
int32_t m_Achievement_count;
bool m_Achievement_countIsSet;
int32_t m_Badge_count;
bool m_Badge_countIsSet;
int32_t m_Download_count;
bool m_Download_countIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_Application_H_ */

View File

@ -0,0 +1,64 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApplicationType.h
*
*
*/
#ifndef TRIBUFU_MODELS_ApplicationType_H_
#define TRIBUFU_MODELS_ApplicationType_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class ApplicationType
: public ModelBase
{
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
{
ApplicationType_APPLICATION,
ApplicationType_GAME,
};
eApplicationType getValue() const;
void setValue(eApplicationType const value);
protected:
eApplicationType m_value;
};
}
}
#endif /* TRIBUFU_MODELS_ApplicationType_H_ */

View File

@ -0,0 +1,122 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AuthorizeRequest.h
*
*
*/
#ifndef TRIBUFU_MODELS_AuthorizeRequest_H_
#define TRIBUFU_MODELS_AuthorizeRequest_H_
#include <stdexcept>
#include "tribufu++/ModelBase.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
{
public:
AuthorizeRequest();
virtual ~AuthorizeRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// AuthorizeRequest members
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 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);
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 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;
utility::string_t m_Code_challenge;
bool m_Code_challengeIsSet;
std::shared_ptr<CodeChallengeMethod> m_Code_challenge_method;
bool m_Code_challenge_methodIsSet;
utility::string_t m_Redirect_uri;
bool m_Redirect_uriIsSet;
utility::string_t m_Scope;
bool m_ScopeIsSet;
utility::string_t m_State;
bool m_StateIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_AuthorizeRequest_H_ */

View File

@ -0,0 +1,64 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* CodeChallengeMethod.h
*
*
*/
#ifndef TRIBUFU_MODELS_CodeChallengeMethod_H_
#define TRIBUFU_MODELS_CodeChallengeMethod_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class CodeChallengeMethod
: public ModelBase
{
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
{
CodeChallengeMethod_PLAIN,
CodeChallengeMethod_S256,
};
eCodeChallengeMethod getValue() const;
void setValue(eCodeChallengeMethod const value);
protected:
eCodeChallengeMethod m_value;
};
}
}
#endif /* TRIBUFU_MODELS_CodeChallengeMethod_H_ */

View File

@ -0,0 +1,79 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
CryptoViewModel();
virtual ~CryptoViewModel();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// CryptoViewModel members
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);
protected:
utility::string_t m_Encoded;
bool m_EncodedIsSet;
utility::string_t m_Decoded;
bool m_DecodedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_CryptoViewModel_H_ */

View File

@ -0,0 +1,313 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Game.h
*
*
*/
#ifndef TRIBUFU_MODELS_Game_H_
#define TRIBUFU_MODELS_Game_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/ApplicationType.h"
namespace tribufu {
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 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 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);
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);
protected:
int32_t m_Game_port;
bool m_Game_portIsSet;
int32_t m_Query_port;
bool m_Query_portIsSet;
int32_t m_Rcon_port;
bool m_Rcon_portIsSet;
int32_t m_Server_count;
bool m_Server_countIsSet;
int32_t m_Steam_app_id;
bool m_Steam_app_idIsSet;
int32_t m_Steam_server_app_id;
bool m_Steam_server_app_idIsSet;
bool m_Enable_servers;
bool m_Enable_serversIsSet;
utility::string_t m_Rust_gamedig_id;
bool m_Rust_gamedig_idIsSet;
utility::string_t m_Node_gamedig_id;
bool m_Node_gamedig_idIsSet;
utility::string_t m_Server_connect_url;
bool m_Server_connect_urlIsSet;
utility::string_t m_Server_tags;
bool m_Server_tagsIsSet;
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Description;
bool m_DescriptionIsSet;
std::shared_ptr<ApplicationType> m_Type;
bool m_TypeIsSet;
utility::string_t m_Organization_id;
bool m_Organization_idIsSet;
utility::string_t m_Icon_url;
bool m_Icon_urlIsSet;
utility::string_t m_Banner_url;
bool m_Banner_urlIsSet;
utility::string_t m_Capsule_image_url;
bool m_Capsule_image_urlIsSet;
utility::string_t m_Library_image_url;
bool m_Library_image_urlIsSet;
utility::string_t m_Parent_id;
bool m_Parent_idIsSet;
utility::string_t m_Slug;
bool m_SlugIsSet;
int32_t m_Visibility;
bool m_VisibilityIsSet;
utility::string_t m_Password;
bool m_PasswordIsSet;
int32_t m_Primary;
bool m_PrimaryIsSet;
int32_t m_User_count;
bool m_User_countIsSet;
int32_t m_Achievement_count;
bool m_Achievement_countIsSet;
int32_t m_Badge_count;
bool m_Badge_countIsSet;
int32_t m_Download_count;
bool m_Download_countIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_Game_H_ */

View File

@ -0,0 +1,313 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* GameServer.h
*
*
*/
#ifndef TRIBUFU_MODELS_GameServer_H_
#define TRIBUFU_MODELS_GameServer_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/ServerStatus.h"
namespace tribufu {
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);
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 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);
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);
protected:
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Description;
bool m_DescriptionIsSet;
utility::string_t m_Address;
bool m_AddressIsSet;
int32_t m_Game_port;
bool m_Game_portIsSet;
int32_t m_Query_port;
bool m_Query_portIsSet;
utility::string_t m_Game_id;
bool m_Game_idIsSet;
utility::string_t m_Game_icon_url;
bool m_Game_icon_urlIsSet;
utility::string_t m_Version;
bool m_VersionIsSet;
bool m_Featured;
bool m_FeaturedIsSet;
utility::string_t m_Cluster_id;
bool m_Cluster_idIsSet;
utility::string_t m_Website_url;
bool m_Website_urlIsSet;
utility::string_t m_Banner_url;
bool m_Banner_urlIsSet;
utility::string_t m_Owner_id;
bool m_Owner_idIsSet;
double m_Uptime;
bool m_UptimeIsSet;
std::shared_ptr<ServerStatus> m_Status;
bool m_StatusIsSet;
int32_t m_Ping;
bool m_PingIsSet;
utility::string_t m_map;
bool m_mapIsSet;
int32_t m_Used_slots;
bool m_Used_slotsIsSet;
int32_t m_Max_slots;
bool m_Max_slotsIsSet;
utility::string_t m_Motd;
bool m_MotdIsSet;
utility::string_t m_Players;
bool m_PlayersIsSet;
utility::datetime m_Last_online;
bool m_Last_onlineIsSet;
utility::string_t m_Country;
bool m_CountryIsSet;
bool m_Steam;
bool m_SteamIsSet;
utility::string_t m_Discord_server_id;
bool m_Discord_server_idIsSet;
utility::string_t m_Youtube_video_url;
bool m_Youtube_video_urlIsSet;
utility::string_t m_Tags;
bool m_TagsIsSet;
int32_t m_Comment_count;
bool m_Comment_countIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_GameServer_H_ */

View File

@ -0,0 +1,175 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
GameServerCluster();
virtual ~GameServerCluster();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// GameServerCluster 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 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 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 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 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 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 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;
utility::string_t m_Description;
bool m_DescriptionIsSet;
utility::string_t m_Game_id;
bool m_Game_idIsSet;
utility::string_t m_Website_url;
bool m_Website_urlIsSet;
utility::string_t m_Banner_url;
bool m_Banner_urlIsSet;
utility::string_t m_Owner_id;
bool m_Owner_idIsSet;
utility::string_t m_Discord_server_id;
bool m_Discord_server_idIsSet;
utility::string_t m_Youtube_video_url;
bool m_Youtube_video_urlIsSet;
utility::string_t m_Tags;
bool m_TagsIsSet;
int32_t m_Comment_count;
bool m_Comment_countIsSet;
int32_t m_Server_count;
bool m_Server_countIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_GameServerCluster_H_ */

View File

@ -0,0 +1,66 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* GrantType.h
*
*
*/
#ifndef TRIBUFU_MODELS_GrantType_H_
#define TRIBUFU_MODELS_GrantType_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class GrantType
: public ModelBase
{
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
{
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_ */

View File

@ -0,0 +1,191 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
Group();
virtual ~Group();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// Group members
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 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 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 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);
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 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 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);
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);
protected:
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Uuid;
bool m_UuidIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Tag;
bool m_TagIsSet;
utility::string_t m_Description;
bool m_DescriptionIsSet;
int32_t m_Type;
bool m_TypeIsSet;
int32_t m_Privacy;
bool m_PrivacyIsSet;
utility::string_t m_Owner_id;
bool m_Owner_idIsSet;
bool m_Verified;
bool m_VerifiedIsSet;
utility::string_t m_Photo_url;
bool m_Photo_urlIsSet;
utility::string_t m_Banner_url;
bool m_Banner_urlIsSet;
int32_t m_Member_count;
bool m_Member_countIsSet;
int32_t m_Follower_count;
bool m_Follower_countIsSet;
int32_t m_View_count;
bool m_View_countIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_Group_H_ */

View File

@ -0,0 +1,124 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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"
namespace tribufu {
namespace models {
class Group;
class Application;
class GroupGame
: public ModelBase
{
public:
GroupGame();
virtual ~GroupGame();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// GroupGame members
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);
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<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 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;
std::shared_ptr<Group> m_Group;
bool m_GroupIsSet;
utility::string_t m_Application_id;
bool m_Application_idIsSet;
std::shared_ptr<Application> m_Application;
bool m_ApplicationIsSet;
std::shared_ptr<AnyType> m_Stats;
bool m_StatsIsSet;
utility::datetime m_Acquired;
bool m_AcquiredIsSet;
utility::datetime m_Last_used;
bool m_Last_usedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_GroupGame_H_ */

View File

@ -0,0 +1,137 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* GroupMember.h
*
*
*/
#ifndef TRIBUFU_MODELS_GroupMember_H_
#define TRIBUFU_MODELS_GroupMember_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/GroupRank.h"
namespace tribufu {
namespace models {
class GroupMember
: public ModelBase
{
public:
GroupMember();
virtual ~GroupMember();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// GroupMember members
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 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);
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::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);
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;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Display_name;
bool m_Display_nameIsSet;
bool m_Verified;
bool m_VerifiedIsSet;
utility::string_t m_Photo_url;
bool m_Photo_urlIsSet;
utility::datetime m_Last_online;
bool m_Last_onlineIsSet;
std::shared_ptr<GroupRank> m_Rank;
bool m_RankIsSet;
utility::datetime m_Since;
bool m_SinceIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_GroupMember_H_ */

View File

@ -0,0 +1,65 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* GroupRank.h
*
*
*/
#ifndef TRIBUFU_MODELS_GroupRank_H_
#define TRIBUFU_MODELS_GroupRank_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class GroupRank
: public ModelBase
{
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
{
GroupRank_MEMBER,
GroupRank_LEADER,
GroupRank_OWNER,
};
eGroupRank getValue() const;
void setValue(eGroupRank const value);
protected:
eGroupRank m_value;
};
}
}
#endif /* TRIBUFU_MODELS_GroupRank_H_ */

View File

@ -0,0 +1,71 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
HashViewModel();
virtual ~HashViewModel();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// HashViewModel members
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;
};
}
}
#endif /* TRIBUFU_MODELS_HashViewModel_H_ */

View File

@ -0,0 +1,81 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* IntrospectRequest.h
*
*
*/
#ifndef TRIBUFU_MODELS_IntrospectRequest_H_
#define TRIBUFU_MODELS_IntrospectRequest_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/TokenHintType.h"
namespace tribufu {
namespace models {
class IntrospectRequest
: public ModelBase
{
public:
IntrospectRequest();
virtual ~IntrospectRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// IntrospectRequest members
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);
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_ */

View File

@ -0,0 +1,207 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
IpAddress();
virtual ~IpAddress();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// IpAddress members
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);
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);
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 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 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 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 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 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);
float getLatitude() const;
bool latitudeIsSet() const;
void unsetLatitude();
void setLatitude(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;
utility::string_t m_Network;
bool m_NetworkIsSet;
bool m_Reserved;
bool m_ReservedIsSet;
utility::string_t m_Asn;
bool m_AsnIsSet;
utility::string_t m_Isp;
bool m_IspIsSet;
utility::string_t m_Continent;
bool m_ContinentIsSet;
utility::string_t m_Country;
bool m_CountryIsSet;
utility::string_t m_Region;
bool m_RegionIsSet;
utility::string_t m_City;
bool m_CityIsSet;
utility::string_t m_Postal_code;
bool m_Postal_codeIsSet;
utility::string_t m_Calling_code;
bool m_Calling_codeIsSet;
utility::string_t m_Tld;
bool m_TldIsSet;
utility::string_t m_Language;
bool m_LanguageIsSet;
utility::string_t m_Timezone;
bool m_TimezoneIsSet;
utility::string_t m_Currency;
bool m_CurrencyIsSet;
float m_Latitude;
bool m_LatitudeIsSet;
float m_Longitude;
bool m_LongitudeIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_IpAddress_H_ */

View File

@ -0,0 +1,111 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
LeaderboardItem();
virtual ~LeaderboardItem();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// LeaderboardItem members
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 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);
double getExperience() const;
bool experienceIsSet() const;
void unsetExperience();
void setExperience(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;
utility::string_t m_Photo_url;
bool m_Photo_urlIsSet;
int32_t m_Level;
bool m_LevelIsSet;
double m_Experience;
bool m_ExperienceIsSet;
double m_Points;
bool m_PointsIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_LeaderboardItem_H_ */

View File

@ -0,0 +1,64 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* LeaderboardOrder.h
*
*
*/
#ifndef TRIBUFU_MODELS_LeaderboardOrder_H_
#define TRIBUFU_MODELS_LeaderboardOrder_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class LeaderboardOrder
: public ModelBase
{
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
{
LeaderboardOrder_LEVEL,
LeaderboardOrder_POINTS,
};
eLeaderboardOrder getValue() const;
void setValue(eLeaderboardOrder const value);
protected:
eLeaderboardOrder m_value;
};
}
}
#endif /* TRIBUFU_MODELS_LeaderboardOrder_H_ */

View File

@ -0,0 +1,69 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* LoginProvider.h
*
*
*/
#ifndef TRIBUFU_MODELS_LoginProvider_H_
#define TRIBUFU_MODELS_LoginProvider_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class LoginProvider
: public ModelBase
{
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
{
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_ */

View File

@ -0,0 +1,79 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
LoginRequest();
virtual ~LoginRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// LoginRequest members
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);
protected:
utility::string_t m_Login;
bool m_LoginIsSet;
utility::string_t m_Password;
bool m_PasswordIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_LoginRequest_H_ */

View File

@ -0,0 +1,97 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
LoginResponse();
virtual ~LoginResponse();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// LoginResponse members
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 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);
protected:
std::shared_ptr<UserInfo> m_User;
bool m_UserIsSet;
utility::string_t m_Access_token;
bool m_Access_tokenIsSet;
utility::string_t m_Refresh_token;
bool m_Refresh_tokenIsSet;
int64_t m_Expires_in;
bool m_Expires_inIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_LoginResponse_H_ */

View File

@ -0,0 +1,159 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
Package();
virtual ~Package();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// Package 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 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 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);
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);
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 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;
utility::string_t m_Description;
bool m_DescriptionIsSet;
utility::string_t m_Image_url;
bool m_Image_urlIsSet;
utility::string_t m_Author_id;
bool m_Author_idIsSet;
utility::string_t m_Version;
bool m_VersionIsSet;
utility::string_t m_File_url;
bool m_File_urlIsSet;
double m_Raw_size;
bool m_Raw_sizeIsSet;
int32_t m_Download_count;
bool m_Download_countIsSet;
utility::datetime m_Last_download;
bool m_Last_downloadIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_Package_H_ */

View File

@ -0,0 +1,207 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
Profile();
virtual ~Profile();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// Profile members
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 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);
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);
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);
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);
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 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::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);
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);
protected:
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Uuid;
bool m_UuidIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Display_name;
bool m_Display_nameIsSet;
bool m_Verified;
bool m_VerifiedIsSet;
int32_t m_Level;
bool m_LevelIsSet;
double m_Experience;
bool m_ExperienceIsSet;
bool m_Public_birthday;
bool m_Public_birthdayIsSet;
utility::datetime m_Birthday;
bool m_BirthdayIsSet;
double m_Points;
bool m_PointsIsSet;
utility::string_t m_Location;
bool m_LocationIsSet;
utility::string_t m_Photo_url;
bool m_Photo_urlIsSet;
utility::string_t m_Banner_url;
bool m_Banner_urlIsSet;
utility::datetime m_Last_online;
bool m_Last_onlineIsSet;
utility::string_t m_Biography;
bool m_BiographyIsSet;
int32_t m_View_count;
bool m_View_countIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_Profile_H_ */

View File

@ -0,0 +1,152 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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"
namespace tribufu {
namespace models {
class ProfileGame
: public ModelBase
{
public:
ProfileGame();
virtual ~ProfileGame();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// ProfileGame 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 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 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);
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);
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 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;
utility::string_t m_Capsule_image_url;
bool m_Capsule_image_urlIsSet;
utility::string_t m_Library_image_url;
bool m_Library_image_urlIsSet;
utility::string_t m_Slug;
bool m_SlugIsSet;
double m_Time_used;
bool m_Time_usedIsSet;
int32_t m_Unlocked_achievements;
bool m_Unlocked_achievementsIsSet;
int32_t m_Total_achievements;
bool m_Total_achievementsIsSet;
std::shared_ptr<AnyType> m_Stats;
bool m_StatsIsSet;
utility::datetime m_Acquired;
bool m_AcquiredIsSet;
utility::datetime m_Last_used;
bool m_Last_usedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_ProfileGame_H_ */

View File

@ -0,0 +1,145 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ProfileGroup.h
*
*
*/
#ifndef TRIBUFU_MODELS_ProfileGroup_H_
#define TRIBUFU_MODELS_ProfileGroup_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/GroupRank.h"
namespace tribufu {
namespace models {
class ProfileGroup
: public ModelBase
{
public:
ProfileGroup();
virtual ~ProfileGroup();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// ProfileGroup members
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 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);
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);
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);
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);
protected:
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Uuid;
bool m_UuidIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Tag;
bool m_TagIsSet;
int32_t m_Privacy;
bool m_PrivacyIsSet;
bool m_Verified;
bool m_VerifiedIsSet;
utility::string_t m_Photo_url;
bool m_Photo_urlIsSet;
int32_t m_Member_count;
bool m_Member_countIsSet;
std::shared_ptr<GroupRank> m_Rank;
bool m_RankIsSet;
utility::datetime m_Since;
bool m_SinceIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_ProfileGroup_H_ */

View File

@ -0,0 +1,71 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
RefreshRequest();
virtual ~RefreshRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// RefreshRequest members
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;
};
}
}
#endif /* TRIBUFU_MODELS_RefreshRequest_H_ */

View File

@ -0,0 +1,95 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
RegisterRequest();
virtual ~RegisterRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// RegisterRequest members
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 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);
protected:
utility::string_t m_Uuid;
bool m_UuidIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Email;
bool m_EmailIsSet;
utility::string_t m_Password;
bool m_PasswordIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_RegisterRequest_H_ */

View File

@ -0,0 +1,64 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ResponseType.h
*
*
*/
#ifndef TRIBUFU_MODELS_ResponseType_H_
#define TRIBUFU_MODELS_ResponseType_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class ResponseType
: public ModelBase
{
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
{
ResponseType_CODE,
ResponseType_TOKEN,
};
eResponseType getValue() const;
void setValue(eResponseType const value);
protected:
eResponseType m_value;
};
}
}
#endif /* TRIBUFU_MODELS_ResponseType_H_ */

View File

@ -0,0 +1,81 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* RevokeRequest.h
*
*
*/
#ifndef TRIBUFU_MODELS_RevokeRequest_H_
#define TRIBUFU_MODELS_RevokeRequest_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/TokenHintType.h"
namespace tribufu {
namespace models {
class RevokeRequest
: public ModelBase
{
public:
RevokeRequest();
virtual ~RevokeRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// RevokeRequest members
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);
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_ */

View File

@ -0,0 +1,97 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SearchRequest.h
*
*
*/
#ifndef TRIBUFU_MODELS_SearchRequest_H_
#define TRIBUFU_MODELS_SearchRequest_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include "tribufu++/model/SearchType.h"
#include <cpprest/details/basic_types.h>
namespace tribufu {
namespace models {
class SearchRequest
: public ModelBase
{
public:
SearchRequest();
virtual ~SearchRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// SearchRequest members
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);
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);
protected:
std::shared_ptr<SearchType> m_Type;
bool m_TypeIsSet;
utility::string_t m_Query;
bool m_QueryIsSet;
int32_t m_Page;
bool m_PageIsSet;
utility::string_t m_Game_id;
bool m_Game_idIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_SearchRequest_H_ */

View File

@ -0,0 +1,66 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SearchType.h
*
*
*/
#ifndef TRIBUFU_MODELS_SearchType_H_
#define TRIBUFU_MODELS_SearchType_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class SearchType
: public ModelBase
{
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
{
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_ */

View File

@ -0,0 +1,86 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ServerMetrics.h
*
*
*/
#ifndef TRIBUFU_MODELS_ServerMetrics_H_
#define TRIBUFU_MODELS_ServerMetrics_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class ServerMetrics
: public ModelBase
{
public:
ServerMetrics();
virtual ~ServerMetrics();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// ServerMetrics members
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 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;
int32_t m_Country_count;
bool m_Country_countIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_ServerMetrics_H_ */

View File

@ -0,0 +1,65 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ServerStatus.h
*
*
*/
#ifndef TRIBUFU_MODELS_ServerStatus_H_
#define TRIBUFU_MODELS_ServerStatus_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class ServerStatus
: public ModelBase
{
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
{
ServerStatus_UNKNOWN,
ServerStatus_OFFLINE,
ServerStatus_ONLINE,
};
eServerStatus getValue() const;
void setValue(eServerStatus const value);
protected:
eServerStatus m_value;
};
}
}
#endif /* TRIBUFU_MODELS_ServerStatus_H_ */

View File

@ -0,0 +1,120 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
Subscription();
virtual ~Subscription();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// Subscription 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 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);
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);
protected:
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Description;
bool m_DescriptionIsSet;
utility::string_t m_Image_url;
bool m_Image_urlIsSet;
std::map<utility::string_t, double> m_Prices;
bool m_PricesIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_Subscription_H_ */

View File

@ -0,0 +1,64 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* TokenHintType.h
*
*
*/
#ifndef TRIBUFU_MODELS_TokenHintType_H_
#define TRIBUFU_MODELS_TokenHintType_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class TokenHintType
: public ModelBase
{
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
{
TokenHintType_ACCESS_TOKEN,
TokenHintType_REFRESH_TOKEN,
};
eTokenHintType getValue() const;
void setValue(eTokenHintType const value);
protected:
eTokenHintType m_value;
};
}
}
#endif /* TRIBUFU_MODELS_TokenHintType_H_ */

View File

@ -0,0 +1,129 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* TokenRequest.h
*
*
*/
#ifndef TRIBUFU_MODELS_TokenRequest_H_
#define TRIBUFU_MODELS_TokenRequest_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "tribufu++/model/GrantType.h"
namespace tribufu {
namespace models {
class TokenRequest
: public ModelBase
{
public:
TokenRequest();
virtual ~TokenRequest();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// TokenRequest members
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 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 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 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);
protected:
std::shared_ptr<GrantType> m_Grant_type;
bool m_Grant_typeIsSet;
utility::string_t m_Code;
bool m_CodeIsSet;
utility::string_t m_Username;
bool m_UsernameIsSet;
utility::string_t m_Password;
bool m_PasswordIsSet;
utility::string_t m_Refresh_token;
bool m_Refresh_tokenIsSet;
utility::string_t m_Client_id;
bool m_Client_idIsSet;
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_ */

View File

@ -0,0 +1,113 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* TokenResponse.h
*
*
*/
#ifndef TRIBUFU_MODELS_TokenResponse_H_
#define TRIBUFU_MODELS_TokenResponse_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include "tribufu++/model/TokenType.h"
#include <cpprest/details/basic_types.h>
namespace tribufu {
namespace models {
class TokenResponse
: public ModelBase
{
public:
TokenResponse();
virtual ~TokenResponse();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// TokenResponse members
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 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 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);
protected:
std::shared_ptr<TokenType> m_Token_type;
bool m_Token_typeIsSet;
utility::string_t m_Access_token;
bool m_Access_tokenIsSet;
utility::string_t m_Refresh_token;
bool m_Refresh_tokenIsSet;
utility::string_t m_Scope;
bool m_ScopeIsSet;
utility::string_t m_State;
bool m_StateIsSet;
int64_t m_Expires_in;
bool m_Expires_inIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_TokenResponse_H_ */

View File

@ -0,0 +1,63 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* TokenType.h
*
*
*/
#ifndef TRIBUFU_MODELS_TokenType_H_
#define TRIBUFU_MODELS_TokenType_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class TokenType
: public ModelBase
{
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
{
TokenType_BEARER,
};
eTokenType getValue() const;
void setValue(eTokenType const value);
protected:
eTokenType m_value;
};
}
}
#endif /* TRIBUFU_MODELS_TokenType_H_ */

View File

@ -0,0 +1,79 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* 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
{
public:
UpdateProfile();
virtual ~UpdateProfile();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// UpdateProfile members
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);
protected:
utility::string_t m_Display_name;
bool m_Display_nameIsSet;
utility::string_t m_Biography;
bool m_BiographyIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_UpdateProfile_H_ */

View File

@ -0,0 +1,265 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* UserInfo.h
*
*
*/
#ifndef TRIBUFU_MODELS_UserInfo_H_
#define TRIBUFU_MODELS_UserInfo_H_
#include <stdexcept>
#include "tribufu++/ModelBase.h"
#include "tribufu++/model/UserType.h"
#include <cpprest/details/basic_types.h>
namespace tribufu {
namespace models {
class UserInfo
: public ModelBase
{
public:
UserInfo();
virtual ~UserInfo();
/////////////////////////////////////////////
/// 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;
/////////////////////////////////////////////
/// UserInfo members
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 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 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);
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);
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);
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);
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);
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 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 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::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);
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 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;
utility::string_t m_Name;
bool m_NameIsSet;
utility::string_t m_Display_name;
bool m_Display_nameIsSet;
utility::string_t m_Email;
bool m_EmailIsSet;
std::shared_ptr<UserType> m_Type;
bool m_TypeIsSet;
utility::string_t m_Flags;
bool m_FlagsIsSet;
utility::string_t m_Permissions;
bool m_PermissionsIsSet;
bool m_Verified;
bool m_VerifiedIsSet;
int32_t m_Level;
bool m_LevelIsSet;
double m_Experience;
bool m_ExperienceIsSet;
bool m_Public_birthday;
bool m_Public_birthdayIsSet;
utility::datetime m_Birthday;
bool m_BirthdayIsSet;
double m_Points;
bool m_PointsIsSet;
utility::string_t m_Location;
bool m_LocationIsSet;
utility::string_t m_Language;
bool m_LanguageIsSet;
utility::string_t m_Timezone;
bool m_TimezoneIsSet;
utility::string_t m_Currency;
bool m_CurrencyIsSet;
utility::string_t m_Photo_url;
bool m_Photo_urlIsSet;
utility::string_t m_Banner_url;
bool m_Banner_urlIsSet;
utility::datetime m_Last_online;
bool m_Last_onlineIsSet;
utility::string_t m_Biography;
bool m_BiographyIsSet;
int32_t m_View_count;
bool m_View_countIsSet;
utility::datetime m_Created;
bool m_CreatedIsSet;
utility::datetime m_Updated;
bool m_UpdatedIsSet;
};
}
}
#endif /* TRIBUFU_MODELS_UserInfo_H_ */

View File

@ -0,0 +1,64 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* UserType.h
*
*
*/
#ifndef TRIBUFU_MODELS_UserType_H_
#define TRIBUFU_MODELS_UserType_H_
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
class UserType
: public ModelBase
{
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
{
UserType_USER,
UserType_BOT,
};
eUserType getValue() const;
void setValue(eUserType const value);
protected:
eUserType m_value;
};
}
}
#endif /* TRIBUFU_MODELS_UserType_H_ */

7
scripts/cmake.ps1 Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env sh
# cmake -G "Visual Studio 17 2022" -A x64
# cmake -B build -S . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake -G "Unix Makefiles"

View File

@ -5,6 +5,6 @@ java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
-g cpp-restsdk `
-o . `
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
--additional-properties=packageName=tribufu,apiPackage=tribufu::api,modelPackage=tribufu::models `
--additional-properties=packageName=tribufu++,apiPackage=tribufu.api,modelPackage=tribufu.models `
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
--skip-validate-spec

View File

@ -1,10 +1,3 @@
#!/usr/bin/env sh
# Linux (x64)
make config=debug_linux-x64
# Linux (x86)
make config=debug_linux-x86
# Linux (arm64)
make config=debug_linux-arm64

49
src/AnyType.cpp Normal file
View File

@ -0,0 +1,49 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/AnyType.h"
namespace tribufu {
namespace models {
AnyType::AnyType() { m_value = web::json::value::null(); }
AnyType::~AnyType() {}
void AnyType::validate() {}
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;
}
}
}

205
src/ApiClient.cpp Normal file
View File

@ -0,0 +1,205 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/ApiClient.h"
#include "tribufu++/MultipartFormData.h"
#include "tribufu++/ModelBase.h"
#include <sstream>
#include <limits>
#include <iomanip>
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();
}
namespace tribufu {
namespace api {
using namespace tribufu::models;
ApiClient::ApiClient(std::shared_ptr<const ApiConfiguration> configuration )
: m_Configuration(configuration)
{
}
ApiClient::~ApiClient()
{
}
const ApiClient::ResponseHandlerType& ApiClient::getResponseHandler() const {
return m_ResponseHandler;
}
void ApiClient::setResponseHandler(const ResponseHandlerType& responseHandler) {
m_ResponseHandler = responseHandler;
}
std::shared_ptr<const ApiConfiguration> ApiClient::getConfiguration() const
{
return m_Configuration;
}
void ApiClient::setConfiguration(std::shared_ptr<const ApiConfiguration> configuration)
{
m_Configuration = configuration;
}
utility::string_t ApiClient::parameterToString(utility::string_t value)
{
return value;
}
utility::string_t ApiClient::parameterToString(int64_t value)
{
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}
utility::string_t ApiClient::parameterToString(int32_t value)
{
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}
utility::string_t ApiClient::parameterToString(float value)
{
return utility::conversions::to_string_t(toString(value));
}
utility::string_t ApiClient::parameterToString(double value)
{
return utility::conversions::to_string_t(toString(value));
}
utility::string_t ApiClient::parameterToString(const utility::datetime &value)
{
return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601));
}
utility::string_t ApiClient::parameterToString(bool value)
{
std::stringstream valueAsStringStream;
valueAsStringStream << std::boolalpha << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}
pplx::task<web::http::http_response> ApiClient::callApi(
const utility::string_t& path,
const utility::string_t& method,
const std::map<utility::string_t, utility::string_t>& queryParams,
const std::shared_ptr<IHttpBody> postBody,
const std::map<utility::string_t, utility::string_t>& headerParams,
const std::map<utility::string_t, utility::string_t>& formParams,
const std::map<utility::string_t, std::shared_ptr<HttpContent>>& fileParams,
const utility::string_t& contentType
) const
{
if (postBody != nullptr && formParams.size() != 0)
{
throw ApiException(400, utility::conversions::to_string_t("Cannot have body and form params"));
}
if (postBody != nullptr && fileParams.size() != 0)
{
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)
{
uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second));
}
for (const auto& kvp : fileParams)
{
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)
{
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);
}
else
{
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);
}
}
}

82
src/ApiConfiguration.cpp Normal file
View File

@ -0,0 +1,82 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/ApiConfiguration.h"
namespace tribufu {
namespace api {
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;
}
}
}

50
src/ApiException.cpp Normal file
View File

@ -0,0 +1,50 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#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)
{
}
ApiException::ApiException( int errorCode
, const utility::string_t& message
, std::map<utility::string_t, utility::string_t>& headers
, std::shared_ptr<std::istream> content /*= nullptr*/ )
: web::http::http_exception( errorCode, message )
, m_Content(content)
, m_Headers(headers)
{
}
ApiException::~ApiException()
{
}
std::shared_ptr<std::istream> ApiException::getContent() const
{
return m_Content;
}
std::map<utility::string_t, utility::string_t>& ApiException::getHeaders()
{
return m_Headers;
}
}
}

83
src/HttpContent.cpp Normal file
View File

@ -0,0 +1,83 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/HttpContent.h"
namespace tribufu {
namespace models {
HttpContent::HttpContent()
{
}
HttpContent::~HttpContent()
{
}
utility::string_t HttpContent::getContentDisposition() const
{
return m_ContentDisposition;
}
void HttpContent::setContentDisposition( const utility::string_t & value )
{
m_ContentDisposition = value;
}
utility::string_t HttpContent::getName() const
{
return m_Name;
}
void HttpContent::setName( const utility::string_t & value )
{
m_Name = value;
}
utility::string_t HttpContent::getFileName() const
{
return m_FileName;
}
void HttpContent::setFileName( const utility::string_t & value )
{
m_FileName = value;
}
utility::string_t HttpContent::getContentType() const
{
return m_ContentType;
}
void HttpContent::setContentType( const utility::string_t & value )
{
m_ContentType = value;
}
std::shared_ptr<std::istream> HttpContent::getData() const
{
return m_Data;
}
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();
}
}
}

33
src/JsonBody.cpp Normal file
View File

@ -0,0 +1,33 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/JsonBody.h"
namespace tribufu {
namespace models {
JsonBody::JsonBody( const web::json::value& json)
: m_Json(json)
{
}
JsonBody::~JsonBody()
{
}
void JsonBody::writeTo( std::ostream& target )
{
m_Json.serialize(target);
}
}
}

662
src/ModelBase.cpp Normal file
View File

@ -0,0 +1,662 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/ModelBase.h"
namespace tribufu {
namespace models {
ModelBase::ModelBase(): m_IsSet(false)
{
}
ModelBase::~ModelBase()
{
}
bool ModelBase::isSet() const
{
return m_IsSet;
}
utility::string_t ModelBase::toString( const bool val )
{
utility::stringstream_t ss;
ss << val;
return utility::string_t(ss.str());
}
utility::string_t ModelBase::toString( const float val )
{
utility::stringstream_t ss;
ss << val;
return utility::string_t(ss.str());
}
utility::string_t ModelBase::toString( const double val )
{
utility::stringstream_t ss;
ss << val;
return utility::string_t(ss.str());
}
utility::string_t ModelBase::toString( const int32_t val )
{
utility::stringstream_t ss;
ss << val;
return utility::string_t(ss.str());
}
utility::string_t ModelBase::toString( const int64_t val )
{
utility::stringstream_t ss;
ss << val;
return utility::string_t(ss.str());
}
utility::string_t ModelBase::toString (const utility::string_t &val )
{
utility::stringstream_t ss;
ss << val;
return utility::string_t(ss.str());
}
utility::string_t ModelBase::toString( const utility::datetime &val )
{
return val.to_string(utility::datetime::ISO_8601);
}
utility::string_t ModelBase::toString( const web::json::value &val )
{
return val.serialize();
}
utility::string_t ModelBase::toString( const std::shared_ptr<HttpContent>& val )
{
utility::stringstream_t ss;
if( val != nullptr )
{
ss << val->getData();
}
return utility::string_t(ss.str());
}
web::json::value ModelBase::toJson(bool value)
{
return web::json::value::boolean(value);
}
web::json::value ModelBase::toJson( float value )
{
return web::json::value::number(value);
}
web::json::value ModelBase::toJson( double value )
{
return web::json::value::number(value);
}
web::json::value ModelBase::toJson( int32_t value )
{
return web::json::value::number(value);
}
web::json::value ModelBase::toJson( int64_t value )
{
return web::json::value::number(value);
}
web::json::value ModelBase::toJson( const utility::string_t& value )
{
return web::json::value::string(value);
}
web::json::value ModelBase::toJson( const utility::datetime& value )
{
return web::json::value::string(value.to_string(utility::datetime::ISO_8601));
}
web::json::value ModelBase::toJson( const web::json::value& value )
{
return value;
}
web::json::value ModelBase::toJson( const std::shared_ptr<HttpContent>& content )
{
web::json::value value;
if(content != nullptr)
{
value[utility::conversions::to_string_t("ContentDisposition")] = ModelBase::toJson(content->getContentDisposition());
value[utility::conversions::to_string_t("ContentType")] = ModelBase::toJson(content->getContentType());
value[utility::conversions::to_string_t("FileName")] = ModelBase::toJson(content->getFileName());
value[utility::conversions::to_string_t("InputStream")] = web::json::value::string( ModelBase::toBase64(content->getData()) );
}
return value;
}
web::json::value ModelBase::toJson( const std::shared_ptr<utility::datetime>& val )
{
web::json::value retVal;
if(val != nullptr)
{
retVal = toJson(*val);
}
return retVal;
}
bool ModelBase::fromString( const utility::string_t& val, bool &outVal )
{
utility::stringstream_t ss(val);
bool success = true;
try
{
ss >> outVal;
}
catch (...)
{
success = false;
}
return success;
}
bool ModelBase::fromString( const utility::string_t& val, float &outVal )
{
utility::stringstream_t ss(val);
bool success = true;
try
{
ss >> outVal;
}
catch (...)
{
int64_t intVal = 0;
success = ModelBase::fromString(val, intVal);
if(success)
{
outVal = static_cast<float>(intVal);
}
}
return success;
}
bool ModelBase::fromString( const utility::string_t& val, double &outVal )
{
utility::stringstream_t ss(val);
bool success = true;
try
{
ss >> outVal;
}
catch (...)
{
int64_t intVal = 0;
success = ModelBase::fromString(val, intVal);
if(success)
{
outVal = static_cast<double>(intVal);
}
}
return success;
}
bool ModelBase::fromString( const utility::string_t& val, int32_t &outVal )
{
utility::stringstream_t ss(val);
bool success = true;
try
{
ss >> outVal;
}
catch (...)
{
success = false;
}
return success;
}
bool ModelBase::fromString( const utility::string_t& val, int64_t &outVal )
{
utility::stringstream_t ss(val);
bool success = true;
try
{
ss >> outVal;
}
catch (...)
{
success = false;
}
return success;
}
bool ModelBase::fromString( const utility::string_t& val, utility::string_t &outVal )
{
utility::stringstream_t ss(val);
bool success = true;
try
{
ss >> outVal;
}
catch (...)
{
success = false;
}
return success;
}
bool ModelBase::fromString( const utility::string_t& val, utility::datetime &outVal )
{
bool success = true;
auto dt = utility::datetime::from_string(val, utility::datetime::ISO_8601);
if( dt.is_initialized() )
{
outVal = dt;
}
else
{
success = false;
}
return success;
}
bool ModelBase::fromString( const utility::string_t& val, web::json::value &outVal )
{
outVal = web::json::value::parse(val);
return !outVal.is_null();
}
bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr<HttpContent>& outVal )
{
bool ok = true;
if(outVal == nullptr)
{
outVal = std::shared_ptr<HttpContent>(new HttpContent());
}
if(outVal != nullptr)
{
outVal->setData(std::shared_ptr<std::istream>(new std::stringstream(utility::conversions::to_utf8string(val))));
}
else
{
ok = false;
}
return ok;
}
bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr<utility::datetime>& outVal )
{
bool ok = false;
if(outVal == nullptr)
{
outVal = std::shared_ptr<utility::datetime>(new utility::datetime());
}
if( outVal != nullptr )
{
ok = fromJson(web::json::value::parse(val), *outVal);
}
return ok;
}
bool ModelBase::fromJson( const web::json::value& val, bool & outVal )
{
outVal = !val.is_boolean() ? false : val.as_bool();
return val.is_boolean();
}
bool ModelBase::fromJson( const web::json::value& val, float & outVal )
{
outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits<float>::quiet_NaN(): static_cast<float>(val.as_double());
return val.is_double() || val.is_integer();
}
bool ModelBase::fromJson( const web::json::value& val, double & outVal )
{
outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits<double>::quiet_NaN(): val.as_double();
return val.is_double() || val.is_integer();
}
bool ModelBase::fromJson( const web::json::value& val, int32_t & outVal )
{
outVal = !val.is_integer() ? std::numeric_limits<int32_t>::quiet_NaN() : val.as_integer();
return val.is_integer();
}
bool ModelBase::fromJson( const web::json::value& val, int64_t & outVal )
{
outVal = !val.is_number() ? std::numeric_limits<int64_t>::quiet_NaN() : val.as_number().to_int64();
return val.is_number();
}
bool ModelBase::fromJson( const web::json::value& val, utility::string_t & outVal )
{
outVal = val.is_string() ? val.as_string() : utility::conversions::to_string_t("");
return val.is_string();
}
bool ModelBase::fromJson( const web::json::value& val, utility::datetime & outVal )
{
outVal = val.is_null() ? utility::datetime::from_string(utility::conversions::to_string_t("NULL"), utility::datetime::ISO_8601) : utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601);
return outVal.is_initialized();
}
bool ModelBase::fromJson( const web::json::value& val, web::json::value & outVal )
{
outVal = val;
return !val.is_null();
}
bool ModelBase::fromJson( const web::json::value& val, std::shared_ptr<HttpContent>& content )
{
bool result = false;
if( content != nullptr)
{
result = true;
if(content == nullptr)
{
content = std::shared_ptr<HttpContent>(new HttpContent());
}
if(val.has_field(utility::conversions::to_string_t("ContentDisposition")))
{
utility::string_t value;
result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("ContentDisposition")), value);
content->setContentDisposition( value );
}
if(val.has_field(utility::conversions::to_string_t("ContentType")))
{
utility::string_t value;
result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("ContentType")), value);
content->setContentType( value );
}
if(val.has_field(utility::conversions::to_string_t("FileName")))
{
utility::string_t value;
result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("FileName")), value);
content->setFileName( value );
}
if(val.has_field(utility::conversions::to_string_t("InputStream")))
{
utility::string_t value;
result = result && ModelBase::fromJson(val.at(utility::conversions::to_string_t("InputStream")), value);
content->setData( ModelBase::fromBase64( value ) );
}
}
return result;
}
bool ModelBase::fromJson( const web::json::value& val, std::shared_ptr<utility::datetime> &outVal )
{
bool ok = false;
if(outVal == nullptr)
{
outVal = std::shared_ptr<utility::datetime>(new utility::datetime());
}
if( outVal != nullptr )
{
ok = fromJson(val, *outVal);
}
return ok;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, bool value, const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
std::stringstream* valueAsStringStream = new std::stringstream();
(*valueAsStringStream) << value;
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, float value, const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
std::stringstream* valueAsStringStream = new std::stringstream();
(*valueAsStringStream) << value;
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
std::stringstream* valueAsStringStream = new std::stringstream();
(*valueAsStringStream) << value;
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
std::stringstream* valueAsStringStream = new std::stringstream();
(*valueAsStringStream) << value;
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
std::stringstream* valueAsStringStream = new std::stringstream();
(*valueAsStringStream) << value;
content->setData( std::shared_ptr<std::istream>( valueAsStringStream) ) ;
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType)
{
std::shared_ptr<HttpContent> content(new HttpContent);
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
content->setData( std::shared_ptr<std::istream>( new std::stringstream( utility::conversions::to_utf8string(value) ) ) );
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
content->setData( std::shared_ptr<std::istream>( new std::stringstream( utility::conversions::to_utf8string(value.to_string(utility::datetime::ISO_8601) ) ) ) );
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const web::json::value& value, const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
content->setData( std::shared_ptr<std::istream>( new std::stringstream( utility::conversions::to_utf8string(value.serialize()) ) ) );
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const std::shared_ptr<HttpContent>& value )
{
std::shared_ptr<HttpContent> content( new HttpContent );
if( value != nullptr )
{
content->setName( name );
content->setContentDisposition( value->getContentDisposition() );
content->setContentType( value->getContentType() );
content->setData( value->getData() );
content->setFileName( value->getFileName() );
}
return content;
}
std::shared_ptr<HttpContent> ModelBase::toHttpContent(const utility::string_t& name, const std::shared_ptr<utility::datetime>& value , const utility::string_t& contentType )
{
std::shared_ptr<HttpContent> content( new HttpContent );
if (value != nullptr )
{
content->setName( name );
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
content->setContentType( contentType );
content->setData( std::shared_ptr<std::istream>( new std::stringstream( utility::conversions::to_utf8string( toJson(*value).serialize() ) ) ) );
}
return content;
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, bool & outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
ModelBase::fromHttpContent(val, str);
return fromString(str, outVal);
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, float & outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
ModelBase::fromHttpContent(val, str);
return fromString(str, outVal);
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, double & outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
ModelBase::fromHttpContent(val, str);
return fromString(str, outVal);
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, int32_t & outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
ModelBase::fromHttpContent(val, str);
return fromString(str, outVal);
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, int64_t & outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
ModelBase::fromHttpContent(val, str);
return fromString(str, outVal);
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, utility::string_t & outVal )
{
if( val == nullptr ) return false;
std::shared_ptr<std::istream> data = val->getData();
data->seekg( 0, data->beg );
std::string str((std::istreambuf_iterator<char>(*data.get())),
std::istreambuf_iterator<char>());
outVal = utility::conversions::to_string_t(str);
return true;
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, utility::datetime & outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
ModelBase::fromHttpContent(val, str);
outVal = utility::datetime::from_string(str, utility::datetime::ISO_8601);
return true;
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, web::json::value & outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
ModelBase::fromHttpContent(val, str);
return fromString(str, outVal);
}
bool ModelBase::fromHttpContent(std::shared_ptr<HttpContent> val, std::shared_ptr<HttpContent>& outVal )
{
utility::string_t str;
if( val == nullptr ) return false;
if( outVal == nullptr )
{
outVal = std::shared_ptr<HttpContent>(new HttpContent());
}
ModelBase::fromHttpContent(val, str);
return fromString(str, outVal);
}
// base64 encoding/decoding based on : https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64#C.2B.2B
const static char Base64Chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const static char Base64PadChar = '=';
utility::string_t ModelBase::toBase64( utility::string_t value )
{
std::shared_ptr<std::istream> source( new std::stringstream( utility::conversions::to_utf8string(value) ) );
return ModelBase::toBase64(source);
}
utility::string_t ModelBase::toBase64( std::shared_ptr<std::istream> value )
{
value->seekg( 0, value->end );
size_t length = value->tellg();
value->seekg( 0, value->beg );
utility::string_t base64;
base64.reserve( ((length / 3) + (length % 3 > 0)) * 4 );
char read[3] = { 0 };
uint32_t temp;
for ( size_t idx = 0; idx < length / 3; idx++ )
{
value->read( read, 3 );
temp = (read[0]) << 16;
temp += (read[1]) << 8;
temp += (read[2]);
base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] );
base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] );
base64.append( 1, Base64Chars[(temp & 0x00000FC0) >> 6] );
base64.append( 1, Base64Chars[(temp & 0x0000003F)] );
}
switch ( length % 3 )
{
case 1:
value->read( read, 1 );
temp = read[0] << 16;
base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] );
base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] );
base64.append( 2, Base64PadChar );
break;
case 2:
value->read( read, 2 );
temp = read[0] << 16;
temp += read[1] << 8;
base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] );
base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] );
base64.append( 1, Base64Chars[(temp & 0x00000FC0) >> 6] );
base64.append( 1, Base64PadChar );
break;
}
return base64;
}
std::shared_ptr<std::istream> ModelBase::fromBase64( const utility::string_t& encoded )
{
std::shared_ptr<std::stringstream> result(new std::stringstream);
char outBuf[3] = { 0 };
uint32_t temp = 0;
utility::string_t::const_iterator cursor = encoded.begin();
while ( cursor < encoded.end() )
{
for ( size_t quantumPosition = 0; quantumPosition < 4; quantumPosition++ )
{
temp <<= 6;
if ( *cursor >= 0x41 && *cursor <= 0x5A )
{
temp |= *cursor - 0x41;
}
else if ( *cursor >= 0x61 && *cursor <= 0x7A )
{
temp |= *cursor - 0x47;
}
else if ( *cursor >= 0x30 && *cursor <= 0x39 )
{
temp |= *cursor + 0x04;
}
else if ( *cursor == 0x2B )
{
temp |= 0x3E; //change to 0x2D for URL alphabet
}
else if ( *cursor == 0x2F )
{
temp |= 0x3F; //change to 0x5F for URL alphabet
}
else if ( *cursor == Base64PadChar ) //pad
{
switch ( encoded.end() - cursor )
{
case 1: //One pad character
outBuf[0] = (temp >> 16) & 0x000000FF;
outBuf[1] = (temp >> 8) & 0x000000FF;
result->write( outBuf, 2 );
return result;
case 2: //Two pad characters
outBuf[0] = (temp >> 10) & 0x000000FF;
result->write( outBuf, 1 );
return result;
default:
throw web::json::json_exception( utility::conversions::to_string_t( "Invalid Padding in Base 64!" ).c_str() );
}
}
else
{
throw web::json::json_exception( utility::conversions::to_string_t( "Non-Valid Character in Base 64!" ).c_str() );
}
++cursor;
}
outBuf[0] = (temp >> 16) & 0x000000FF;
outBuf[1] = (temp >> 8) & 0x000000FF;
outBuf[2] = (temp) & 0x000000FF;
result->write( outBuf, 3 );
}
return result;
}
}
}

109
src/MultipartFormData.cpp Normal file
View File

@ -0,0 +1,109 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/MultipartFormData.h"
#include "tribufu++/ModelBase.h"
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
namespace tribufu {
namespace models {
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";
}
}
}

88
src/Object.cpp Normal file
View File

@ -0,0 +1,88 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/Object.h"
namespace tribufu {
namespace models {
Object::Object()
{
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())
{
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;
}
}
}
}

File diff suppressed because it is too large Load Diff

461
src/model/Account.cpp Normal file
View File

@ -0,0 +1,461 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/Account.h"
namespace tribufu {
namespace models {
Account::Account()
{
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"))))
{
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;
}
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;
}
}
}

1045
src/model/Application.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,118 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/ApplicationType.h"
namespace tribufu {
namespace models {
namespace
{
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;
}
}
}

View File

@ -0,0 +1,413 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/AuthorizeRequest.h"
namespace tribufu {
namespace models {
AuthorizeRequest::AuthorizeRequest()
{
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"))))
{
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;
}
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;
}
}
}

View File

@ -0,0 +1,118 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/CodeChallengeMethod.h"
namespace tribufu {
namespace models {
namespace
{
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;
}
}
}

View File

@ -0,0 +1,170 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/CryptoViewModel.h"
namespace tribufu {
namespace models {
CryptoViewModel::CryptoViewModel()
{
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"))))
{
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;
}
}
}

1577
src/model/Game.cpp Normal file

File diff suppressed because it is too large Load Diff

1581
src/model/GameServer.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,756 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/GameServerCluster.h"
namespace tribufu {
namespace models {
GameServerCluster::GameServerCluster()
{
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_Game_id = utility::conversions::to_string_t("");
m_Game_idIsSet = false;
m_Website_url = utility::conversions::to_string_t("");
m_Website_urlIsSet = false;
m_Banner_url = utility::conversions::to_string_t("");
m_Banner_urlIsSet = false;
m_Owner_id = utility::conversions::to_string_t("");
m_Owner_idIsSet = false;
m_Discord_server_id = utility::conversions::to_string_t("");
m_Discord_server_idIsSet = false;
m_Youtube_video_url = utility::conversions::to_string_t("");
m_Youtube_video_urlIsSet = false;
m_Tags = utility::conversions::to_string_t("");
m_TagsIsSet = false;
m_Comment_count = 0;
m_Comment_countIsSet = false;
m_Server_count = 0;
m_Server_countIsSet = false;
m_Created = utility::datetime();
m_CreatedIsSet = false;
m_Updated = utility::datetime();
m_UpdatedIsSet = false;
}
GameServerCluster::~GameServerCluster()
{
}
void GameServerCluster::validate()
{
// TODO: implement validation
}
web::json::value GameServerCluster::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_Game_idIsSet)
{
val[utility::conversions::to_string_t(U("game_id"))] = ModelBase::toJson(m_Game_id);
}
if(m_Website_urlIsSet)
{
val[utility::conversions::to_string_t(U("website_url"))] = ModelBase::toJson(m_Website_url);
}
if(m_Banner_urlIsSet)
{
val[utility::conversions::to_string_t(U("banner_url"))] = ModelBase::toJson(m_Banner_url);
}
if(m_Owner_idIsSet)
{
val[utility::conversions::to_string_t(U("owner_id"))] = ModelBase::toJson(m_Owner_id);
}
if(m_Discord_server_idIsSet)
{
val[utility::conversions::to_string_t(U("discord_server_id"))] = ModelBase::toJson(m_Discord_server_id);
}
if(m_Youtube_video_urlIsSet)
{
val[utility::conversions::to_string_t(U("youtube_video_url"))] = ModelBase::toJson(m_Youtube_video_url);
}
if(m_TagsIsSet)
{
val[utility::conversions::to_string_t(U("tags"))] = ModelBase::toJson(m_Tags);
}
if(m_Comment_countIsSet)
{
val[utility::conversions::to_string_t(U("comment_count"))] = ModelBase::toJson(m_Comment_count);
}
if(m_Server_countIsSet)
{
val[utility::conversions::to_string_t(U("server_count"))] = ModelBase::toJson(m_Server_count);
}
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 GameServerCluster::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t(U("id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null())
{
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("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);
}
}
if(val.has_field(utility::conversions::to_string_t(U("website_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("website_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setWebsiteUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setWebsiteUrl);
setWebsiteUrl(refVal_setWebsiteUrl);
}
}
if(val.has_field(utility::conversions::to_string_t(U("banner_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("banner_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setBannerUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setBannerUrl);
setBannerUrl(refVal_setBannerUrl);
}
}
if(val.has_field(utility::conversions::to_string_t(U("owner_id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("owner_id")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setOwnerId;
ok &= ModelBase::fromJson(fieldValue, refVal_setOwnerId);
setOwnerId(refVal_setOwnerId);
}
}
if(val.has_field(utility::conversions::to_string_t(U("discord_server_id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("discord_server_id")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setDiscordServerId;
ok &= ModelBase::fromJson(fieldValue, refVal_setDiscordServerId);
setDiscordServerId(refVal_setDiscordServerId);
}
}
if(val.has_field(utility::conversions::to_string_t(U("youtube_video_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("youtube_video_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setYoutubeVideoUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setYoutubeVideoUrl);
setYoutubeVideoUrl(refVal_setYoutubeVideoUrl);
}
}
if(val.has_field(utility::conversions::to_string_t(U("tags"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tags")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setTags;
ok &= ModelBase::fromJson(fieldValue, refVal_setTags);
setTags(refVal_setTags);
}
}
if(val.has_field(utility::conversions::to_string_t(U("comment_count"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("comment_count")));
if(!fieldValue.is_null())
{
int32_t refVal_setCommentCount;
ok &= ModelBase::fromJson(fieldValue, refVal_setCommentCount);
setCommentCount(refVal_setCommentCount);
}
}
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("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;
}
void GameServerCluster::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_Game_idIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("game_id")), m_Game_id));
}
if(m_Website_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("website_url")), m_Website_url));
}
if(m_Banner_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("banner_url")), m_Banner_url));
}
if(m_Owner_idIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("owner_id")), m_Owner_id));
}
if(m_Discord_server_idIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("discord_server_id")), m_Discord_server_id));
}
if(m_Youtube_video_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("youtube_video_url")), m_Youtube_video_url));
}
if(m_TagsIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tags")), m_Tags));
}
if(m_Comment_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("comment_count")), m_Comment_count));
}
if(m_Server_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("server_count")), m_Server_count));
}
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 GameServerCluster::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("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);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("website_url"))))
{
utility::string_t refVal_setWebsiteUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("website_url"))), refVal_setWebsiteUrl );
setWebsiteUrl(refVal_setWebsiteUrl);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("banner_url"))))
{
utility::string_t refVal_setBannerUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("banner_url"))), refVal_setBannerUrl );
setBannerUrl(refVal_setBannerUrl);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("owner_id"))))
{
utility::string_t refVal_setOwnerId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("owner_id"))), refVal_setOwnerId );
setOwnerId(refVal_setOwnerId);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("discord_server_id"))))
{
utility::string_t refVal_setDiscordServerId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("discord_server_id"))), refVal_setDiscordServerId );
setDiscordServerId(refVal_setDiscordServerId);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("youtube_video_url"))))
{
utility::string_t refVal_setYoutubeVideoUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("youtube_video_url"))), refVal_setYoutubeVideoUrl );
setYoutubeVideoUrl(refVal_setYoutubeVideoUrl);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("tags"))))
{
utility::string_t refVal_setTags;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags );
setTags(refVal_setTags);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("comment_count"))))
{
int32_t refVal_setCommentCount;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("comment_count"))), refVal_setCommentCount );
setCommentCount(refVal_setCommentCount);
}
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("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 GameServerCluster::getId() const
{
return m_Id;
}
void GameServerCluster::setId(const utility::string_t& value)
{
m_Id = value;
m_IdIsSet = true;
}
bool GameServerCluster::idIsSet() const
{
return m_IdIsSet;
}
void GameServerCluster::unsetId()
{
m_IdIsSet = false;
}
utility::string_t GameServerCluster::getName() const
{
return m_Name;
}
void GameServerCluster::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool GameServerCluster::nameIsSet() const
{
return m_NameIsSet;
}
void GameServerCluster::unsetName()
{
m_NameIsSet = false;
}
utility::string_t GameServerCluster::getDescription() const
{
return m_Description;
}
void GameServerCluster::setDescription(const utility::string_t& value)
{
m_Description = value;
m_DescriptionIsSet = true;
}
bool GameServerCluster::descriptionIsSet() const
{
return m_DescriptionIsSet;
}
void GameServerCluster::unsetDescription()
{
m_DescriptionIsSet = false;
}
utility::string_t GameServerCluster::getGameId() const
{
return m_Game_id;
}
void GameServerCluster::setGameId(const utility::string_t& value)
{
m_Game_id = value;
m_Game_idIsSet = true;
}
bool GameServerCluster::gameIdIsSet() const
{
return m_Game_idIsSet;
}
void GameServerCluster::unsetGame_id()
{
m_Game_idIsSet = false;
}
utility::string_t GameServerCluster::getWebsiteUrl() const
{
return m_Website_url;
}
void GameServerCluster::setWebsiteUrl(const utility::string_t& value)
{
m_Website_url = value;
m_Website_urlIsSet = true;
}
bool GameServerCluster::websiteUrlIsSet() const
{
return m_Website_urlIsSet;
}
void GameServerCluster::unsetWebsite_url()
{
m_Website_urlIsSet = false;
}
utility::string_t GameServerCluster::getBannerUrl() const
{
return m_Banner_url;
}
void GameServerCluster::setBannerUrl(const utility::string_t& value)
{
m_Banner_url = value;
m_Banner_urlIsSet = true;
}
bool GameServerCluster::bannerUrlIsSet() const
{
return m_Banner_urlIsSet;
}
void GameServerCluster::unsetBanner_url()
{
m_Banner_urlIsSet = false;
}
utility::string_t GameServerCluster::getOwnerId() const
{
return m_Owner_id;
}
void GameServerCluster::setOwnerId(const utility::string_t& value)
{
m_Owner_id = value;
m_Owner_idIsSet = true;
}
bool GameServerCluster::ownerIdIsSet() const
{
return m_Owner_idIsSet;
}
void GameServerCluster::unsetOwner_id()
{
m_Owner_idIsSet = false;
}
utility::string_t GameServerCluster::getDiscordServerId() const
{
return m_Discord_server_id;
}
void GameServerCluster::setDiscordServerId(const utility::string_t& value)
{
m_Discord_server_id = value;
m_Discord_server_idIsSet = true;
}
bool GameServerCluster::discordServerIdIsSet() const
{
return m_Discord_server_idIsSet;
}
void GameServerCluster::unsetDiscord_server_id()
{
m_Discord_server_idIsSet = false;
}
utility::string_t GameServerCluster::getYoutubeVideoUrl() const
{
return m_Youtube_video_url;
}
void GameServerCluster::setYoutubeVideoUrl(const utility::string_t& value)
{
m_Youtube_video_url = value;
m_Youtube_video_urlIsSet = true;
}
bool GameServerCluster::youtubeVideoUrlIsSet() const
{
return m_Youtube_video_urlIsSet;
}
void GameServerCluster::unsetYoutube_video_url()
{
m_Youtube_video_urlIsSet = false;
}
utility::string_t GameServerCluster::getTags() const
{
return m_Tags;
}
void GameServerCluster::setTags(const utility::string_t& value)
{
m_Tags = value;
m_TagsIsSet = true;
}
bool GameServerCluster::tagsIsSet() const
{
return m_TagsIsSet;
}
void GameServerCluster::unsetTags()
{
m_TagsIsSet = false;
}
int32_t GameServerCluster::getCommentCount() const
{
return m_Comment_count;
}
void GameServerCluster::setCommentCount(int32_t value)
{
m_Comment_count = value;
m_Comment_countIsSet = true;
}
bool GameServerCluster::commentCountIsSet() const
{
return m_Comment_countIsSet;
}
void GameServerCluster::unsetComment_count()
{
m_Comment_countIsSet = false;
}
int32_t GameServerCluster::getServerCount() const
{
return m_Server_count;
}
void GameServerCluster::setServerCount(int32_t value)
{
m_Server_count = value;
m_Server_countIsSet = true;
}
bool GameServerCluster::serverCountIsSet() const
{
return m_Server_countIsSet;
}
void GameServerCluster::unsetServer_count()
{
m_Server_countIsSet = false;
}
utility::datetime GameServerCluster::getCreated() const
{
return m_Created;
}
void GameServerCluster::setCreated(const utility::datetime& value)
{
m_Created = value;
m_CreatedIsSet = true;
}
bool GameServerCluster::createdIsSet() const
{
return m_CreatedIsSet;
}
void GameServerCluster::unsetCreated()
{
m_CreatedIsSet = false;
}
utility::datetime GameServerCluster::getUpdated() const
{
return m_Updated;
}
void GameServerCluster::setUpdated(const utility::datetime& value)
{
m_Updated = value;
m_UpdatedIsSet = true;
}
bool GameServerCluster::updatedIsSet() const
{
return m_UpdatedIsSet;
}
void GameServerCluster::unsetUpdated()
{
m_UpdatedIsSet = false;
}
}
}

126
src/model/GrantType.cpp Normal file
View File

@ -0,0 +1,126 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/GrantType.h"
namespace tribufu {
namespace models {
namespace
{
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;
}
}
}

850
src/model/Group.cpp Normal file
View File

@ -0,0 +1,850 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/Group.h"
namespace tribufu {
namespace models {
Group::Group()
{
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_Tag = utility::conversions::to_string_t("");
m_TagIsSet = false;
m_Description = utility::conversions::to_string_t("");
m_DescriptionIsSet = false;
m_Type = 0;
m_TypeIsSet = false;
m_Privacy = 0;
m_PrivacyIsSet = false;
m_Owner_id = utility::conversions::to_string_t("");
m_Owner_idIsSet = false;
m_Verified = false;
m_VerifiedIsSet = false;
m_Photo_url = utility::conversions::to_string_t("");
m_Photo_urlIsSet = false;
m_Banner_url = utility::conversions::to_string_t("");
m_Banner_urlIsSet = false;
m_Member_count = 0;
m_Member_countIsSet = false;
m_Follower_count = 0;
m_Follower_countIsSet = false;
m_View_count = 0;
m_View_countIsSet = false;
m_Created = utility::datetime();
m_CreatedIsSet = false;
m_Updated = utility::datetime();
m_UpdatedIsSet = false;
}
Group::~Group()
{
}
void Group::validate()
{
// TODO: implement validation
}
web::json::value Group::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_TagIsSet)
{
val[utility::conversions::to_string_t(U("tag"))] = ModelBase::toJson(m_Tag);
}
if(m_DescriptionIsSet)
{
val[utility::conversions::to_string_t(U("description"))] = ModelBase::toJson(m_Description);
}
if(m_TypeIsSet)
{
val[utility::conversions::to_string_t(U("type"))] = ModelBase::toJson(m_Type);
}
if(m_PrivacyIsSet)
{
val[utility::conversions::to_string_t(U("privacy"))] = ModelBase::toJson(m_Privacy);
}
if(m_Owner_idIsSet)
{
val[utility::conversions::to_string_t(U("owner_id"))] = ModelBase::toJson(m_Owner_id);
}
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_Banner_urlIsSet)
{
val[utility::conversions::to_string_t(U("banner_url"))] = ModelBase::toJson(m_Banner_url);
}
if(m_Member_countIsSet)
{
val[utility::conversions::to_string_t(U("member_count"))] = ModelBase::toJson(m_Member_count);
}
if(m_Follower_countIsSet)
{
val[utility::conversions::to_string_t(U("follower_count"))] = ModelBase::toJson(m_Follower_count);
}
if(m_View_countIsSet)
{
val[utility::conversions::to_string_t(U("view_count"))] = ModelBase::toJson(m_View_count);
}
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 Group::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t(U("id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null())
{
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("tag"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tag")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setTag;
ok &= ModelBase::fromJson(fieldValue, refVal_setTag);
setTag(refVal_setTag);
}
}
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("type"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type")));
if(!fieldValue.is_null())
{
int32_t refVal_setType;
ok &= ModelBase::fromJson(fieldValue, refVal_setType);
setType(refVal_setType);
}
}
if(val.has_field(utility::conversions::to_string_t(U("privacy"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("privacy")));
if(!fieldValue.is_null())
{
int32_t refVal_setPrivacy;
ok &= ModelBase::fromJson(fieldValue, refVal_setPrivacy);
setPrivacy(refVal_setPrivacy);
}
}
if(val.has_field(utility::conversions::to_string_t(U("owner_id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("owner_id")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setOwnerId;
ok &= ModelBase::fromJson(fieldValue, refVal_setOwnerId);
setOwnerId(refVal_setOwnerId);
}
}
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("banner_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("banner_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setBannerUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setBannerUrl);
setBannerUrl(refVal_setBannerUrl);
}
}
if(val.has_field(utility::conversions::to_string_t(U("member_count"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("member_count")));
if(!fieldValue.is_null())
{
int32_t refVal_setMemberCount;
ok &= ModelBase::fromJson(fieldValue, refVal_setMemberCount);
setMemberCount(refVal_setMemberCount);
}
}
if(val.has_field(utility::conversions::to_string_t(U("follower_count"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("follower_count")));
if(!fieldValue.is_null())
{
int32_t refVal_setFollowerCount;
ok &= ModelBase::fromJson(fieldValue, refVal_setFollowerCount);
setFollowerCount(refVal_setFollowerCount);
}
}
if(val.has_field(utility::conversions::to_string_t(U("view_count"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("view_count")));
if(!fieldValue.is_null())
{
int32_t refVal_setViewCount;
ok &= ModelBase::fromJson(fieldValue, refVal_setViewCount);
setViewCount(refVal_setViewCount);
}
}
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;
}
void Group::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_TagIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tag")), m_Tag));
}
if(m_DescriptionIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("description")), m_Description));
}
if(m_TypeIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("type")), m_Type));
}
if(m_PrivacyIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("privacy")), m_Privacy));
}
if(m_Owner_idIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("owner_id")), m_Owner_id));
}
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_Banner_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("banner_url")), m_Banner_url));
}
if(m_Member_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("member_count")), m_Member_count));
}
if(m_Follower_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("follower_count")), m_Follower_count));
}
if(m_View_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("view_count")), m_View_count));
}
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 Group::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("tag"))))
{
utility::string_t refVal_setTag;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tag"))), refVal_setTag );
setTag(refVal_setTag);
}
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("type"))))
{
int32_t 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("privacy"))))
{
int32_t refVal_setPrivacy;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("privacy"))), refVal_setPrivacy );
setPrivacy(refVal_setPrivacy);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("owner_id"))))
{
utility::string_t refVal_setOwnerId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("owner_id"))), refVal_setOwnerId );
setOwnerId(refVal_setOwnerId);
}
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("banner_url"))))
{
utility::string_t refVal_setBannerUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("banner_url"))), refVal_setBannerUrl );
setBannerUrl(refVal_setBannerUrl);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("member_count"))))
{
int32_t refVal_setMemberCount;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("member_count"))), refVal_setMemberCount );
setMemberCount(refVal_setMemberCount);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("follower_count"))))
{
int32_t refVal_setFollowerCount;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("follower_count"))), refVal_setFollowerCount );
setFollowerCount(refVal_setFollowerCount);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("view_count"))))
{
int32_t refVal_setViewCount;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("view_count"))), refVal_setViewCount );
setViewCount(refVal_setViewCount);
}
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 Group::getId() const
{
return m_Id;
}
void Group::setId(const utility::string_t& value)
{
m_Id = value;
m_IdIsSet = true;
}
bool Group::idIsSet() const
{
return m_IdIsSet;
}
void Group::unsetId()
{
m_IdIsSet = false;
}
utility::string_t Group::getUuid() const
{
return m_Uuid;
}
void Group::setUuid(const utility::string_t& value)
{
m_Uuid = value;
m_UuidIsSet = true;
}
bool Group::uuidIsSet() const
{
return m_UuidIsSet;
}
void Group::unsetUuid()
{
m_UuidIsSet = false;
}
utility::string_t Group::getName() const
{
return m_Name;
}
void Group::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool Group::nameIsSet() const
{
return m_NameIsSet;
}
void Group::unsetName()
{
m_NameIsSet = false;
}
utility::string_t Group::getTag() const
{
return m_Tag;
}
void Group::setTag(const utility::string_t& value)
{
m_Tag = value;
m_TagIsSet = true;
}
bool Group::tagIsSet() const
{
return m_TagIsSet;
}
void Group::unsetTag()
{
m_TagIsSet = false;
}
utility::string_t Group::getDescription() const
{
return m_Description;
}
void Group::setDescription(const utility::string_t& value)
{
m_Description = value;
m_DescriptionIsSet = true;
}
bool Group::descriptionIsSet() const
{
return m_DescriptionIsSet;
}
void Group::unsetDescription()
{
m_DescriptionIsSet = false;
}
int32_t Group::getType() const
{
return m_Type;
}
void Group::setType(int32_t value)
{
m_Type = value;
m_TypeIsSet = true;
}
bool Group::typeIsSet() const
{
return m_TypeIsSet;
}
void Group::unsetType()
{
m_TypeIsSet = false;
}
int32_t Group::getPrivacy() const
{
return m_Privacy;
}
void Group::setPrivacy(int32_t value)
{
m_Privacy = value;
m_PrivacyIsSet = true;
}
bool Group::privacyIsSet() const
{
return m_PrivacyIsSet;
}
void Group::unsetPrivacy()
{
m_PrivacyIsSet = false;
}
utility::string_t Group::getOwnerId() const
{
return m_Owner_id;
}
void Group::setOwnerId(const utility::string_t& value)
{
m_Owner_id = value;
m_Owner_idIsSet = true;
}
bool Group::ownerIdIsSet() const
{
return m_Owner_idIsSet;
}
void Group::unsetOwner_id()
{
m_Owner_idIsSet = false;
}
bool Group::isVerified() const
{
return m_Verified;
}
void Group::setVerified(bool value)
{
m_Verified = value;
m_VerifiedIsSet = true;
}
bool Group::verifiedIsSet() const
{
return m_VerifiedIsSet;
}
void Group::unsetVerified()
{
m_VerifiedIsSet = false;
}
utility::string_t Group::getPhotoUrl() const
{
return m_Photo_url;
}
void Group::setPhotoUrl(const utility::string_t& value)
{
m_Photo_url = value;
m_Photo_urlIsSet = true;
}
bool Group::photoUrlIsSet() const
{
return m_Photo_urlIsSet;
}
void Group::unsetPhoto_url()
{
m_Photo_urlIsSet = false;
}
utility::string_t Group::getBannerUrl() const
{
return m_Banner_url;
}
void Group::setBannerUrl(const utility::string_t& value)
{
m_Banner_url = value;
m_Banner_urlIsSet = true;
}
bool Group::bannerUrlIsSet() const
{
return m_Banner_urlIsSet;
}
void Group::unsetBanner_url()
{
m_Banner_urlIsSet = false;
}
int32_t Group::getMemberCount() const
{
return m_Member_count;
}
void Group::setMemberCount(int32_t value)
{
m_Member_count = value;
m_Member_countIsSet = true;
}
bool Group::memberCountIsSet() const
{
return m_Member_countIsSet;
}
void Group::unsetMember_count()
{
m_Member_countIsSet = false;
}
int32_t Group::getFollowerCount() const
{
return m_Follower_count;
}
void Group::setFollowerCount(int32_t value)
{
m_Follower_count = value;
m_Follower_countIsSet = true;
}
bool Group::followerCountIsSet() const
{
return m_Follower_countIsSet;
}
void Group::unsetFollower_count()
{
m_Follower_countIsSet = false;
}
int32_t Group::getViewCount() const
{
return m_View_count;
}
void Group::setViewCount(int32_t value)
{
m_View_count = value;
m_View_countIsSet = true;
}
bool Group::viewCountIsSet() const
{
return m_View_countIsSet;
}
void Group::unsetView_count()
{
m_View_countIsSet = false;
}
utility::datetime Group::getCreated() const
{
return m_Created;
}
void Group::setCreated(const utility::datetime& value)
{
m_Created = value;
m_CreatedIsSet = true;
}
bool Group::createdIsSet() const
{
return m_CreatedIsSet;
}
void Group::unsetCreated()
{
m_CreatedIsSet = false;
}
utility::datetime Group::getUpdated() const
{
return m_Updated;
}
void Group::setUpdated(const utility::datetime& value)
{
m_Updated = value;
m_UpdatedIsSet = true;
}
bool Group::updatedIsSet() const
{
return m_UpdatedIsSet;
}
void Group::unsetUpdated()
{
m_UpdatedIsSet = false;
}
}
}

412
src/model/GroupGame.cpp Normal file
View File

@ -0,0 +1,412 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/GroupGame.h"
namespace tribufu {
namespace models {
GroupGame::GroupGame()
{
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"))))
{
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;
}
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;
}
}
}

511
src/model/GroupMember.cpp Normal file
View File

@ -0,0 +1,511 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/GroupMember.h"
namespace tribufu {
namespace models {
GroupMember::GroupMember()
{
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"))))
{
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;
}
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;
}
}
}

122
src/model/GroupRank.cpp Normal file
View File

@ -0,0 +1,122 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/GroupRank.h"
namespace tribufu {
namespace models {
namespace
{
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;
}
}
}

121
src/model/HashViewModel.cpp Normal file
View File

@ -0,0 +1,121 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/HashViewModel.h"
namespace tribufu {
namespace models {
HashViewModel::HashViewModel()
{
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;
}
}
}

View File

@ -0,0 +1,169 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/IntrospectRequest.h"
namespace tribufu {
namespace models {
IntrospectRequest::IntrospectRequest()
{
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"))))
{
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;
}
}
}

950
src/model/IpAddress.cpp Normal file
View File

@ -0,0 +1,950 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/IpAddress.h"
namespace tribufu {
namespace models {
IpAddress::IpAddress()
{
m_Address = utility::conversions::to_string_t("");
m_AddressIsSet = false;
m_Version = 0;
m_VersionIsSet = false;
m_Network = utility::conversions::to_string_t("");
m_NetworkIsSet = false;
m_Reserved = false;
m_ReservedIsSet = false;
m_Asn = utility::conversions::to_string_t("");
m_AsnIsSet = false;
m_Isp = utility::conversions::to_string_t("");
m_IspIsSet = false;
m_Continent = utility::conversions::to_string_t("");
m_ContinentIsSet = false;
m_Country = utility::conversions::to_string_t("");
m_CountryIsSet = false;
m_Region = utility::conversions::to_string_t("");
m_RegionIsSet = false;
m_City = utility::conversions::to_string_t("");
m_CityIsSet = false;
m_Postal_code = utility::conversions::to_string_t("");
m_Postal_codeIsSet = false;
m_Calling_code = utility::conversions::to_string_t("");
m_Calling_codeIsSet = false;
m_Tld = utility::conversions::to_string_t("");
m_TldIsSet = false;
m_Language = utility::conversions::to_string_t("");
m_LanguageIsSet = false;
m_Timezone = utility::conversions::to_string_t("");
m_TimezoneIsSet = false;
m_Currency = utility::conversions::to_string_t("");
m_CurrencyIsSet = false;
m_Latitude = 0.0f;
m_LatitudeIsSet = false;
m_Longitude = 0.0f;
m_LongitudeIsSet = false;
}
IpAddress::~IpAddress()
{
}
void IpAddress::validate()
{
// TODO: implement validation
}
web::json::value IpAddress::toJson() const
{
web::json::value val = web::json::value::object();
if(m_AddressIsSet)
{
val[utility::conversions::to_string_t(U("address"))] = ModelBase::toJson(m_Address);
}
if(m_VersionIsSet)
{
val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version);
}
if(m_NetworkIsSet)
{
val[utility::conversions::to_string_t(U("network"))] = ModelBase::toJson(m_Network);
}
if(m_ReservedIsSet)
{
val[utility::conversions::to_string_t(U("reserved"))] = ModelBase::toJson(m_Reserved);
}
if(m_AsnIsSet)
{
val[utility::conversions::to_string_t(U("asn"))] = ModelBase::toJson(m_Asn);
}
if(m_IspIsSet)
{
val[utility::conversions::to_string_t(U("isp"))] = ModelBase::toJson(m_Isp);
}
if(m_ContinentIsSet)
{
val[utility::conversions::to_string_t(U("continent"))] = ModelBase::toJson(m_Continent);
}
if(m_CountryIsSet)
{
val[utility::conversions::to_string_t(U("country"))] = ModelBase::toJson(m_Country);
}
if(m_RegionIsSet)
{
val[utility::conversions::to_string_t(U("region"))] = ModelBase::toJson(m_Region);
}
if(m_CityIsSet)
{
val[utility::conversions::to_string_t(U("city"))] = ModelBase::toJson(m_City);
}
if(m_Postal_codeIsSet)
{
val[utility::conversions::to_string_t(U("postal_code"))] = ModelBase::toJson(m_Postal_code);
}
if(m_Calling_codeIsSet)
{
val[utility::conversions::to_string_t(U("calling_code"))] = ModelBase::toJson(m_Calling_code);
}
if(m_TldIsSet)
{
val[utility::conversions::to_string_t(U("tld"))] = ModelBase::toJson(m_Tld);
}
if(m_LanguageIsSet)
{
val[utility::conversions::to_string_t(U("language"))] = ModelBase::toJson(m_Language);
}
if(m_TimezoneIsSet)
{
val[utility::conversions::to_string_t(U("timezone"))] = ModelBase::toJson(m_Timezone);
}
if(m_CurrencyIsSet)
{
val[utility::conversions::to_string_t(U("currency"))] = ModelBase::toJson(m_Currency);
}
if(m_LatitudeIsSet)
{
val[utility::conversions::to_string_t(U("latitude"))] = ModelBase::toJson(m_Latitude);
}
if(m_LongitudeIsSet)
{
val[utility::conversions::to_string_t(U("longitude"))] = ModelBase::toJson(m_Longitude);
}
return val;
}
bool IpAddress::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t(U("address"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("address")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setAddress;
ok &= ModelBase::fromJson(fieldValue, refVal_setAddress);
setAddress(refVal_setAddress);
}
}
if(val.has_field(utility::conversions::to_string_t(U("version"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version")));
if(!fieldValue.is_null())
{
int32_t refVal_setVersion;
ok &= ModelBase::fromJson(fieldValue, refVal_setVersion);
setVersion(refVal_setVersion);
}
}
if(val.has_field(utility::conversions::to_string_t(U("network"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("network")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setNetwork;
ok &= ModelBase::fromJson(fieldValue, refVal_setNetwork);
setNetwork(refVal_setNetwork);
}
}
if(val.has_field(utility::conversions::to_string_t(U("reserved"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("reserved")));
if(!fieldValue.is_null())
{
bool refVal_setReserved;
ok &= ModelBase::fromJson(fieldValue, refVal_setReserved);
setReserved(refVal_setReserved);
}
}
if(val.has_field(utility::conversions::to_string_t(U("asn"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("asn")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setAsn;
ok &= ModelBase::fromJson(fieldValue, refVal_setAsn);
setAsn(refVal_setAsn);
}
}
if(val.has_field(utility::conversions::to_string_t(U("isp"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("isp")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setIsp;
ok &= ModelBase::fromJson(fieldValue, refVal_setIsp);
setIsp(refVal_setIsp);
}
}
if(val.has_field(utility::conversions::to_string_t(U("continent"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("continent")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setContinent;
ok &= ModelBase::fromJson(fieldValue, refVal_setContinent);
setContinent(refVal_setContinent);
}
}
if(val.has_field(utility::conversions::to_string_t(U("country"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("country")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setCountry;
ok &= ModelBase::fromJson(fieldValue, refVal_setCountry);
setCountry(refVal_setCountry);
}
}
if(val.has_field(utility::conversions::to_string_t(U("region"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("region")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setRegion;
ok &= ModelBase::fromJson(fieldValue, refVal_setRegion);
setRegion(refVal_setRegion);
}
}
if(val.has_field(utility::conversions::to_string_t(U("city"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("city")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setCity;
ok &= ModelBase::fromJson(fieldValue, refVal_setCity);
setCity(refVal_setCity);
}
}
if(val.has_field(utility::conversions::to_string_t(U("postal_code"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("postal_code")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setPostalCode;
ok &= ModelBase::fromJson(fieldValue, refVal_setPostalCode);
setPostalCode(refVal_setPostalCode);
}
}
if(val.has_field(utility::conversions::to_string_t(U("calling_code"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("calling_code")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setCallingCode;
ok &= ModelBase::fromJson(fieldValue, refVal_setCallingCode);
setCallingCode(refVal_setCallingCode);
}
}
if(val.has_field(utility::conversions::to_string_t(U("tld"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tld")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setTld;
ok &= ModelBase::fromJson(fieldValue, refVal_setTld);
setTld(refVal_setTld);
}
}
if(val.has_field(utility::conversions::to_string_t(U("language"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("language")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setLanguage;
ok &= ModelBase::fromJson(fieldValue, refVal_setLanguage);
setLanguage(refVal_setLanguage);
}
}
if(val.has_field(utility::conversions::to_string_t(U("timezone"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("timezone")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setTimezone;
ok &= ModelBase::fromJson(fieldValue, refVal_setTimezone);
setTimezone(refVal_setTimezone);
}
}
if(val.has_field(utility::conversions::to_string_t(U("currency"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("currency")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setCurrency;
ok &= ModelBase::fromJson(fieldValue, refVal_setCurrency);
setCurrency(refVal_setCurrency);
}
}
if(val.has_field(utility::conversions::to_string_t(U("latitude"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("latitude")));
if(!fieldValue.is_null())
{
float refVal_setLatitude;
ok &= ModelBase::fromJson(fieldValue, refVal_setLatitude);
setLatitude(refVal_setLatitude);
}
}
if(val.has_field(utility::conversions::to_string_t(U("longitude"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("longitude")));
if(!fieldValue.is_null())
{
float refVal_setLongitude;
ok &= ModelBase::fromJson(fieldValue, refVal_setLongitude);
setLongitude(refVal_setLongitude);
}
}
return ok;
}
void IpAddress::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_AddressIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("address")), m_Address));
}
if(m_VersionIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version));
}
if(m_NetworkIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("network")), m_Network));
}
if(m_ReservedIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("reserved")), m_Reserved));
}
if(m_AsnIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("asn")), m_Asn));
}
if(m_IspIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("isp")), m_Isp));
}
if(m_ContinentIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("continent")), m_Continent));
}
if(m_CountryIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("country")), m_Country));
}
if(m_RegionIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("region")), m_Region));
}
if(m_CityIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("city")), m_City));
}
if(m_Postal_codeIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("postal_code")), m_Postal_code));
}
if(m_Calling_codeIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("calling_code")), m_Calling_code));
}
if(m_TldIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tld")), m_Tld));
}
if(m_LanguageIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("language")), m_Language));
}
if(m_TimezoneIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("timezone")), m_Timezone));
}
if(m_CurrencyIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("currency")), m_Currency));
}
if(m_LatitudeIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("latitude")), m_Latitude));
}
if(m_LongitudeIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("longitude")), m_Longitude));
}
}
bool IpAddress::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("address"))))
{
utility::string_t refVal_setAddress;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("address"))), refVal_setAddress );
setAddress(refVal_setAddress);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("version"))))
{
int32_t refVal_setVersion;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion );
setVersion(refVal_setVersion);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("network"))))
{
utility::string_t refVal_setNetwork;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("network"))), refVal_setNetwork );
setNetwork(refVal_setNetwork);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("reserved"))))
{
bool refVal_setReserved;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("reserved"))), refVal_setReserved );
setReserved(refVal_setReserved);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("asn"))))
{
utility::string_t refVal_setAsn;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("asn"))), refVal_setAsn );
setAsn(refVal_setAsn);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("isp"))))
{
utility::string_t refVal_setIsp;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("isp"))), refVal_setIsp );
setIsp(refVal_setIsp);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("continent"))))
{
utility::string_t refVal_setContinent;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("continent"))), refVal_setContinent );
setContinent(refVal_setContinent);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("country"))))
{
utility::string_t refVal_setCountry;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("country"))), refVal_setCountry );
setCountry(refVal_setCountry);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("region"))))
{
utility::string_t refVal_setRegion;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("region"))), refVal_setRegion );
setRegion(refVal_setRegion);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("city"))))
{
utility::string_t refVal_setCity;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("city"))), refVal_setCity );
setCity(refVal_setCity);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("postal_code"))))
{
utility::string_t refVal_setPostalCode;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("postal_code"))), refVal_setPostalCode );
setPostalCode(refVal_setPostalCode);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("calling_code"))))
{
utility::string_t refVal_setCallingCode;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("calling_code"))), refVal_setCallingCode );
setCallingCode(refVal_setCallingCode);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("tld"))))
{
utility::string_t refVal_setTld;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tld"))), refVal_setTld );
setTld(refVal_setTld);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("language"))))
{
utility::string_t refVal_setLanguage;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("language"))), refVal_setLanguage );
setLanguage(refVal_setLanguage);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("timezone"))))
{
utility::string_t refVal_setTimezone;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("timezone"))), refVal_setTimezone );
setTimezone(refVal_setTimezone);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("currency"))))
{
utility::string_t refVal_setCurrency;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("currency"))), refVal_setCurrency );
setCurrency(refVal_setCurrency);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("latitude"))))
{
float refVal_setLatitude;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("latitude"))), refVal_setLatitude );
setLatitude(refVal_setLatitude);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("longitude"))))
{
float refVal_setLongitude;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("longitude"))), refVal_setLongitude );
setLongitude(refVal_setLongitude);
}
return ok;
}
utility::string_t IpAddress::getAddress() const
{
return m_Address;
}
void IpAddress::setAddress(const utility::string_t& value)
{
m_Address = value;
m_AddressIsSet = true;
}
bool IpAddress::addressIsSet() const
{
return m_AddressIsSet;
}
void IpAddress::unsetAddress()
{
m_AddressIsSet = false;
}
int32_t IpAddress::getVersion() const
{
return m_Version;
}
void IpAddress::setVersion(int32_t value)
{
m_Version = value;
m_VersionIsSet = true;
}
bool IpAddress::versionIsSet() const
{
return m_VersionIsSet;
}
void IpAddress::unsetVersion()
{
m_VersionIsSet = false;
}
utility::string_t IpAddress::getNetwork() const
{
return m_Network;
}
void IpAddress::setNetwork(const utility::string_t& value)
{
m_Network = value;
m_NetworkIsSet = true;
}
bool IpAddress::networkIsSet() const
{
return m_NetworkIsSet;
}
void IpAddress::unsetNetwork()
{
m_NetworkIsSet = false;
}
bool IpAddress::isReserved() const
{
return m_Reserved;
}
void IpAddress::setReserved(bool value)
{
m_Reserved = value;
m_ReservedIsSet = true;
}
bool IpAddress::reservedIsSet() const
{
return m_ReservedIsSet;
}
void IpAddress::unsetReserved()
{
m_ReservedIsSet = false;
}
utility::string_t IpAddress::getAsn() const
{
return m_Asn;
}
void IpAddress::setAsn(const utility::string_t& value)
{
m_Asn = value;
m_AsnIsSet = true;
}
bool IpAddress::asnIsSet() const
{
return m_AsnIsSet;
}
void IpAddress::unsetAsn()
{
m_AsnIsSet = false;
}
utility::string_t IpAddress::getIsp() const
{
return m_Isp;
}
void IpAddress::setIsp(const utility::string_t& value)
{
m_Isp = value;
m_IspIsSet = true;
}
bool IpAddress::ispIsSet() const
{
return m_IspIsSet;
}
void IpAddress::unsetIsp()
{
m_IspIsSet = false;
}
utility::string_t IpAddress::getContinent() const
{
return m_Continent;
}
void IpAddress::setContinent(const utility::string_t& value)
{
m_Continent = value;
m_ContinentIsSet = true;
}
bool IpAddress::continentIsSet() const
{
return m_ContinentIsSet;
}
void IpAddress::unsetContinent()
{
m_ContinentIsSet = false;
}
utility::string_t IpAddress::getCountry() const
{
return m_Country;
}
void IpAddress::setCountry(const utility::string_t& value)
{
m_Country = value;
m_CountryIsSet = true;
}
bool IpAddress::countryIsSet() const
{
return m_CountryIsSet;
}
void IpAddress::unsetCountry()
{
m_CountryIsSet = false;
}
utility::string_t IpAddress::getRegion() const
{
return m_Region;
}
void IpAddress::setRegion(const utility::string_t& value)
{
m_Region = value;
m_RegionIsSet = true;
}
bool IpAddress::regionIsSet() const
{
return m_RegionIsSet;
}
void IpAddress::unsetRegion()
{
m_RegionIsSet = false;
}
utility::string_t IpAddress::getCity() const
{
return m_City;
}
void IpAddress::setCity(const utility::string_t& value)
{
m_City = value;
m_CityIsSet = true;
}
bool IpAddress::cityIsSet() const
{
return m_CityIsSet;
}
void IpAddress::unsetCity()
{
m_CityIsSet = false;
}
utility::string_t IpAddress::getPostalCode() const
{
return m_Postal_code;
}
void IpAddress::setPostalCode(const utility::string_t& value)
{
m_Postal_code = value;
m_Postal_codeIsSet = true;
}
bool IpAddress::postalCodeIsSet() const
{
return m_Postal_codeIsSet;
}
void IpAddress::unsetPostal_code()
{
m_Postal_codeIsSet = false;
}
utility::string_t IpAddress::getCallingCode() const
{
return m_Calling_code;
}
void IpAddress::setCallingCode(const utility::string_t& value)
{
m_Calling_code = value;
m_Calling_codeIsSet = true;
}
bool IpAddress::callingCodeIsSet() const
{
return m_Calling_codeIsSet;
}
void IpAddress::unsetCalling_code()
{
m_Calling_codeIsSet = false;
}
utility::string_t IpAddress::getTld() const
{
return m_Tld;
}
void IpAddress::setTld(const utility::string_t& value)
{
m_Tld = value;
m_TldIsSet = true;
}
bool IpAddress::tldIsSet() const
{
return m_TldIsSet;
}
void IpAddress::unsetTld()
{
m_TldIsSet = false;
}
utility::string_t IpAddress::getLanguage() const
{
return m_Language;
}
void IpAddress::setLanguage(const utility::string_t& value)
{
m_Language = value;
m_LanguageIsSet = true;
}
bool IpAddress::languageIsSet() const
{
return m_LanguageIsSet;
}
void IpAddress::unsetLanguage()
{
m_LanguageIsSet = false;
}
utility::string_t IpAddress::getTimezone() const
{
return m_Timezone;
}
void IpAddress::setTimezone(const utility::string_t& value)
{
m_Timezone = value;
m_TimezoneIsSet = true;
}
bool IpAddress::timezoneIsSet() const
{
return m_TimezoneIsSet;
}
void IpAddress::unsetTimezone()
{
m_TimezoneIsSet = false;
}
utility::string_t IpAddress::getCurrency() const
{
return m_Currency;
}
void IpAddress::setCurrency(const utility::string_t& value)
{
m_Currency = value;
m_CurrencyIsSet = true;
}
bool IpAddress::currencyIsSet() const
{
return m_CurrencyIsSet;
}
void IpAddress::unsetCurrency()
{
m_CurrencyIsSet = false;
}
float IpAddress::getLatitude() const
{
return m_Latitude;
}
void IpAddress::setLatitude(float value)
{
m_Latitude = value;
m_LatitudeIsSet = true;
}
bool IpAddress::latitudeIsSet() const
{
return m_LatitudeIsSet;
}
void IpAddress::unsetLatitude()
{
m_LatitudeIsSet = false;
}
float IpAddress::getLongitude() const
{
return m_Longitude;
}
void IpAddress::setLongitude(float value)
{
m_Longitude = value;
m_LongitudeIsSet = true;
}
bool IpAddress::longitudeIsSet() const
{
return m_LongitudeIsSet;
}
void IpAddress::unsetLongitude()
{
m_LongitudeIsSet = false;
}
}
}

View File

@ -0,0 +1,363 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/LeaderboardItem.h"
namespace tribufu {
namespace models {
LeaderboardItem::LeaderboardItem()
{
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"))))
{
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;
}
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;
}
}
}

View File

@ -0,0 +1,118 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/LeaderboardOrder.h"
namespace tribufu {
namespace models {
namespace
{
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;
}
}
}

138
src/model/LoginProvider.cpp Normal file
View File

@ -0,0 +1,138 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/LoginProvider.h"
namespace tribufu {
namespace models {
namespace
{
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;
}
}
}

170
src/model/LoginRequest.cpp Normal file
View File

@ -0,0 +1,170 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/LoginRequest.h"
namespace tribufu {
namespace models {
LoginRequest::LoginRequest()
{
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"))))
{
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;
}
}
}

266
src/model/LoginResponse.cpp Normal file
View File

@ -0,0 +1,266 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/LoginResponse.h"
namespace tribufu {
namespace models {
LoginResponse::LoginResponse()
{
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"))))
{
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;
}
}
}

658
src/model/Package.cpp Normal file
View File

@ -0,0 +1,658 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/Package.h"
namespace tribufu {
namespace models {
Package::Package()
{
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_Author_id = utility::conversions::to_string_t("");
m_Author_idIsSet = false;
m_Version = utility::conversions::to_string_t("");
m_VersionIsSet = false;
m_File_url = utility::conversions::to_string_t("");
m_File_urlIsSet = false;
m_Raw_size = 0.0;
m_Raw_sizeIsSet = false;
m_Download_count = 0;
m_Download_countIsSet = false;
m_Last_download = utility::datetime();
m_Last_downloadIsSet = false;
m_Created = utility::datetime();
m_CreatedIsSet = false;
m_Updated = utility::datetime();
m_UpdatedIsSet = false;
}
Package::~Package()
{
}
void Package::validate()
{
// TODO: implement validation
}
web::json::value Package::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_Author_idIsSet)
{
val[utility::conversions::to_string_t(U("author_id"))] = ModelBase::toJson(m_Author_id);
}
if(m_VersionIsSet)
{
val[utility::conversions::to_string_t(U("version"))] = ModelBase::toJson(m_Version);
}
if(m_File_urlIsSet)
{
val[utility::conversions::to_string_t(U("file_url"))] = ModelBase::toJson(m_File_url);
}
if(m_Raw_sizeIsSet)
{
val[utility::conversions::to_string_t(U("raw_size"))] = ModelBase::toJson(m_Raw_size);
}
if(m_Download_countIsSet)
{
val[utility::conversions::to_string_t(U("download_count"))] = ModelBase::toJson(m_Download_count);
}
if(m_Last_downloadIsSet)
{
val[utility::conversions::to_string_t(U("last_download"))] = ModelBase::toJson(m_Last_download);
}
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 Package::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t(U("id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null())
{
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("author_id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("author_id")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setAuthorId;
ok &= ModelBase::fromJson(fieldValue, refVal_setAuthorId);
setAuthorId(refVal_setAuthorId);
}
}
if(val.has_field(utility::conversions::to_string_t(U("version"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("version")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setVersion;
ok &= ModelBase::fromJson(fieldValue, refVal_setVersion);
setVersion(refVal_setVersion);
}
}
if(val.has_field(utility::conversions::to_string_t(U("file_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("file_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setFileUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setFileUrl);
setFileUrl(refVal_setFileUrl);
}
}
if(val.has_field(utility::conversions::to_string_t(U("raw_size"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("raw_size")));
if(!fieldValue.is_null())
{
double refVal_setRawSize;
ok &= ModelBase::fromJson(fieldValue, refVal_setRawSize);
setRawSize(refVal_setRawSize);
}
}
if(val.has_field(utility::conversions::to_string_t(U("download_count"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("download_count")));
if(!fieldValue.is_null())
{
int32_t refVal_setDownloadCount;
ok &= ModelBase::fromJson(fieldValue, refVal_setDownloadCount);
setDownloadCount(refVal_setDownloadCount);
}
}
if(val.has_field(utility::conversions::to_string_t(U("last_download"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("last_download")));
if(!fieldValue.is_null())
{
utility::datetime refVal_setLastDownload;
ok &= ModelBase::fromJson(fieldValue, refVal_setLastDownload);
setLastDownload(refVal_setLastDownload);
}
}
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;
}
void Package::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_Author_idIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("author_id")), m_Author_id));
}
if(m_VersionIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("version")), m_Version));
}
if(m_File_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("file_url")), m_File_url));
}
if(m_Raw_sizeIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("raw_size")), m_Raw_size));
}
if(m_Download_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("download_count")), m_Download_count));
}
if(m_Last_downloadIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("last_download")), m_Last_download));
}
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 Package::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("author_id"))))
{
utility::string_t refVal_setAuthorId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("author_id"))), refVal_setAuthorId );
setAuthorId(refVal_setAuthorId);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("version"))))
{
utility::string_t refVal_setVersion;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("version"))), refVal_setVersion );
setVersion(refVal_setVersion);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("file_url"))))
{
utility::string_t refVal_setFileUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("file_url"))), refVal_setFileUrl );
setFileUrl(refVal_setFileUrl);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("raw_size"))))
{
double refVal_setRawSize;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("raw_size"))), refVal_setRawSize );
setRawSize(refVal_setRawSize);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("download_count"))))
{
int32_t refVal_setDownloadCount;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("download_count"))), refVal_setDownloadCount );
setDownloadCount(refVal_setDownloadCount);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("last_download"))))
{
utility::datetime refVal_setLastDownload;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("last_download"))), refVal_setLastDownload );
setLastDownload(refVal_setLastDownload);
}
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 Package::getId() const
{
return m_Id;
}
void Package::setId(const utility::string_t& value)
{
m_Id = value;
m_IdIsSet = true;
}
bool Package::idIsSet() const
{
return m_IdIsSet;
}
void Package::unsetId()
{
m_IdIsSet = false;
}
utility::string_t Package::getName() const
{
return m_Name;
}
void Package::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool Package::nameIsSet() const
{
return m_NameIsSet;
}
void Package::unsetName()
{
m_NameIsSet = false;
}
utility::string_t Package::getDescription() const
{
return m_Description;
}
void Package::setDescription(const utility::string_t& value)
{
m_Description = value;
m_DescriptionIsSet = true;
}
bool Package::descriptionIsSet() const
{
return m_DescriptionIsSet;
}
void Package::unsetDescription()
{
m_DescriptionIsSet = false;
}
utility::string_t Package::getImageUrl() const
{
return m_Image_url;
}
void Package::setImageUrl(const utility::string_t& value)
{
m_Image_url = value;
m_Image_urlIsSet = true;
}
bool Package::imageUrlIsSet() const
{
return m_Image_urlIsSet;
}
void Package::unsetImage_url()
{
m_Image_urlIsSet = false;
}
utility::string_t Package::getAuthorId() const
{
return m_Author_id;
}
void Package::setAuthorId(const utility::string_t& value)
{
m_Author_id = value;
m_Author_idIsSet = true;
}
bool Package::authorIdIsSet() const
{
return m_Author_idIsSet;
}
void Package::unsetAuthor_id()
{
m_Author_idIsSet = false;
}
utility::string_t Package::getVersion() const
{
return m_Version;
}
void Package::setVersion(const utility::string_t& value)
{
m_Version = value;
m_VersionIsSet = true;
}
bool Package::versionIsSet() const
{
return m_VersionIsSet;
}
void Package::unsetVersion()
{
m_VersionIsSet = false;
}
utility::string_t Package::getFileUrl() const
{
return m_File_url;
}
void Package::setFileUrl(const utility::string_t& value)
{
m_File_url = value;
m_File_urlIsSet = true;
}
bool Package::fileUrlIsSet() const
{
return m_File_urlIsSet;
}
void Package::unsetFile_url()
{
m_File_urlIsSet = false;
}
double Package::getRawSize() const
{
return m_Raw_size;
}
void Package::setRawSize(double value)
{
m_Raw_size = value;
m_Raw_sizeIsSet = true;
}
bool Package::rawSizeIsSet() const
{
return m_Raw_sizeIsSet;
}
void Package::unsetRaw_size()
{
m_Raw_sizeIsSet = false;
}
int32_t Package::getDownloadCount() const
{
return m_Download_count;
}
void Package::setDownloadCount(int32_t value)
{
m_Download_count = value;
m_Download_countIsSet = true;
}
bool Package::downloadCountIsSet() const
{
return m_Download_countIsSet;
}
void Package::unsetDownload_count()
{
m_Download_countIsSet = false;
}
utility::datetime Package::getLastDownload() const
{
return m_Last_download;
}
void Package::setLastDownload(const utility::datetime& value)
{
m_Last_download = value;
m_Last_downloadIsSet = true;
}
bool Package::lastDownloadIsSet() const
{
return m_Last_downloadIsSet;
}
void Package::unsetLast_download()
{
m_Last_downloadIsSet = false;
}
utility::datetime Package::getCreated() const
{
return m_Created;
}
void Package::setCreated(const utility::datetime& value)
{
m_Created = value;
m_CreatedIsSet = true;
}
bool Package::createdIsSet() const
{
return m_CreatedIsSet;
}
void Package::unsetCreated()
{
m_CreatedIsSet = false;
}
utility::datetime Package::getUpdated() const
{
return m_Updated;
}
void Package::setUpdated(const utility::datetime& value)
{
m_Updated = value;
m_UpdatedIsSet = true;
}
bool Package::updatedIsSet() const
{
return m_UpdatedIsSet;
}
void Package::unsetUpdated()
{
m_UpdatedIsSet = false;
}
}
}

947
src/model/Profile.cpp Normal file
View File

@ -0,0 +1,947 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/Profile.h"
namespace tribufu {
namespace models {
Profile::Profile()
{
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_Level = 0;
m_LevelIsSet = false;
m_Experience = 0.0;
m_ExperienceIsSet = false;
m_Public_birthday = false;
m_Public_birthdayIsSet = false;
m_BirthdayIsSet = false;
m_Points = 0.0;
m_PointsIsSet = false;
m_Location = utility::conversions::to_string_t("");
m_LocationIsSet = false;
m_Photo_url = utility::conversions::to_string_t("");
m_Photo_urlIsSet = false;
m_Banner_url = utility::conversions::to_string_t("");
m_Banner_urlIsSet = false;
m_Last_online = utility::datetime();
m_Last_onlineIsSet = false;
m_Biography = utility::conversions::to_string_t("");
m_BiographyIsSet = false;
m_View_count = 0;
m_View_countIsSet = false;
m_Created = utility::datetime();
m_CreatedIsSet = false;
m_Updated = utility::datetime();
m_UpdatedIsSet = false;
}
Profile::~Profile()
{
}
void Profile::validate()
{
// TODO: implement validation
}
web::json::value Profile::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_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_Public_birthdayIsSet)
{
val[utility::conversions::to_string_t(U("public_birthday"))] = ModelBase::toJson(m_Public_birthday);
}
if(m_BirthdayIsSet)
{
val[utility::conversions::to_string_t(U("birthday"))] = ModelBase::toJson(m_Birthday);
}
if(m_PointsIsSet)
{
val[utility::conversions::to_string_t(U("points"))] = ModelBase::toJson(m_Points);
}
if(m_LocationIsSet)
{
val[utility::conversions::to_string_t(U("location"))] = ModelBase::toJson(m_Location);
}
if(m_Photo_urlIsSet)
{
val[utility::conversions::to_string_t(U("photo_url"))] = ModelBase::toJson(m_Photo_url);
}
if(m_Banner_urlIsSet)
{
val[utility::conversions::to_string_t(U("banner_url"))] = ModelBase::toJson(m_Banner_url);
}
if(m_Last_onlineIsSet)
{
val[utility::conversions::to_string_t(U("last_online"))] = ModelBase::toJson(m_Last_online);
}
if(m_BiographyIsSet)
{
val[utility::conversions::to_string_t(U("biography"))] = ModelBase::toJson(m_Biography);
}
if(m_View_countIsSet)
{
val[utility::conversions::to_string_t(U("view_count"))] = ModelBase::toJson(m_View_count);
}
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 Profile::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t(U("id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null())
{
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("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("public_birthday"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("public_birthday")));
if(!fieldValue.is_null())
{
bool refVal_setPublicBirthday;
ok &= ModelBase::fromJson(fieldValue, refVal_setPublicBirthday);
setPublicBirthday(refVal_setPublicBirthday);
}
}
if(val.has_field(utility::conversions::to_string_t(U("birthday"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("birthday")));
if(!fieldValue.is_null())
{
utility::datetime refVal_setBirthday;
ok &= ModelBase::fromJson(fieldValue, refVal_setBirthday);
setBirthday(refVal_setBirthday);
}
}
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);
}
}
if(val.has_field(utility::conversions::to_string_t(U("location"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("location")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setLocation;
ok &= ModelBase::fromJson(fieldValue, refVal_setLocation);
setLocation(refVal_setLocation);
}
}
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("banner_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("banner_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setBannerUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setBannerUrl);
setBannerUrl(refVal_setBannerUrl);
}
}
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("biography"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("biography")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setBiography;
ok &= ModelBase::fromJson(fieldValue, refVal_setBiography);
setBiography(refVal_setBiography);
}
}
if(val.has_field(utility::conversions::to_string_t(U("view_count"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("view_count")));
if(!fieldValue.is_null())
{
int32_t refVal_setViewCount;
ok &= ModelBase::fromJson(fieldValue, refVal_setViewCount);
setViewCount(refVal_setViewCount);
}
}
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;
}
void Profile::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_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_Public_birthdayIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("public_birthday")), m_Public_birthday));
}
if(m_BirthdayIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("birthday")), m_Birthday));
}
if(m_PointsIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("points")), m_Points));
}
if(m_LocationIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("location")), m_Location));
}
if(m_Photo_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("photo_url")), m_Photo_url));
}
if(m_Banner_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("banner_url")), m_Banner_url));
}
if(m_Last_onlineIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("last_online")), m_Last_online));
}
if(m_BiographyIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("biography")), m_Biography));
}
if(m_View_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("view_count")), m_View_count));
}
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 Profile::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("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("public_birthday"))))
{
bool refVal_setPublicBirthday;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("public_birthday"))), refVal_setPublicBirthday );
setPublicBirthday(refVal_setPublicBirthday);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("birthday"))))
{
utility::datetime refVal_setBirthday;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("birthday"))), refVal_setBirthday );
setBirthday(refVal_setBirthday);
}
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);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("location"))))
{
utility::string_t refVal_setLocation;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("location"))), refVal_setLocation );
setLocation(refVal_setLocation);
}
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("banner_url"))))
{
utility::string_t refVal_setBannerUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("banner_url"))), refVal_setBannerUrl );
setBannerUrl(refVal_setBannerUrl);
}
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("biography"))))
{
utility::string_t refVal_setBiography;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("biography"))), refVal_setBiography );
setBiography(refVal_setBiography);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("view_count"))))
{
int32_t refVal_setViewCount;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("view_count"))), refVal_setViewCount );
setViewCount(refVal_setViewCount);
}
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 Profile::getId() const
{
return m_Id;
}
void Profile::setId(const utility::string_t& value)
{
m_Id = value;
m_IdIsSet = true;
}
bool Profile::idIsSet() const
{
return m_IdIsSet;
}
void Profile::unsetId()
{
m_IdIsSet = false;
}
utility::string_t Profile::getUuid() const
{
return m_Uuid;
}
void Profile::setUuid(const utility::string_t& value)
{
m_Uuid = value;
m_UuidIsSet = true;
}
bool Profile::uuidIsSet() const
{
return m_UuidIsSet;
}
void Profile::unsetUuid()
{
m_UuidIsSet = false;
}
utility::string_t Profile::getName() const
{
return m_Name;
}
void Profile::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool Profile::nameIsSet() const
{
return m_NameIsSet;
}
void Profile::unsetName()
{
m_NameIsSet = false;
}
utility::string_t Profile::getDisplayName() const
{
return m_Display_name;
}
void Profile::setDisplayName(const utility::string_t& value)
{
m_Display_name = value;
m_Display_nameIsSet = true;
}
bool Profile::displayNameIsSet() const
{
return m_Display_nameIsSet;
}
void Profile::unsetDisplay_name()
{
m_Display_nameIsSet = false;
}
bool Profile::isVerified() const
{
return m_Verified;
}
void Profile::setVerified(bool value)
{
m_Verified = value;
m_VerifiedIsSet = true;
}
bool Profile::verifiedIsSet() const
{
return m_VerifiedIsSet;
}
void Profile::unsetVerified()
{
m_VerifiedIsSet = false;
}
int32_t Profile::getLevel() const
{
return m_Level;
}
void Profile::setLevel(int32_t value)
{
m_Level = value;
m_LevelIsSet = true;
}
bool Profile::levelIsSet() const
{
return m_LevelIsSet;
}
void Profile::unsetLevel()
{
m_LevelIsSet = false;
}
double Profile::getExperience() const
{
return m_Experience;
}
void Profile::setExperience(double value)
{
m_Experience = value;
m_ExperienceIsSet = true;
}
bool Profile::experienceIsSet() const
{
return m_ExperienceIsSet;
}
void Profile::unsetExperience()
{
m_ExperienceIsSet = false;
}
bool Profile::isPublicBirthday() const
{
return m_Public_birthday;
}
void Profile::setPublicBirthday(bool value)
{
m_Public_birthday = value;
m_Public_birthdayIsSet = true;
}
bool Profile::publicBirthdayIsSet() const
{
return m_Public_birthdayIsSet;
}
void Profile::unsetPublic_birthday()
{
m_Public_birthdayIsSet = false;
}
utility::datetime Profile::getBirthday() const
{
return m_Birthday;
}
void Profile::setBirthday(const utility::datetime& value)
{
m_Birthday = value;
m_BirthdayIsSet = true;
}
bool Profile::birthdayIsSet() const
{
return m_BirthdayIsSet;
}
void Profile::unsetBirthday()
{
m_BirthdayIsSet = false;
}
double Profile::getPoints() const
{
return m_Points;
}
void Profile::setPoints(double value)
{
m_Points = value;
m_PointsIsSet = true;
}
bool Profile::pointsIsSet() const
{
return m_PointsIsSet;
}
void Profile::unsetPoints()
{
m_PointsIsSet = false;
}
utility::string_t Profile::getLocation() const
{
return m_Location;
}
void Profile::setLocation(const utility::string_t& value)
{
m_Location = value;
m_LocationIsSet = true;
}
bool Profile::locationIsSet() const
{
return m_LocationIsSet;
}
void Profile::unsetLocation()
{
m_LocationIsSet = false;
}
utility::string_t Profile::getPhotoUrl() const
{
return m_Photo_url;
}
void Profile::setPhotoUrl(const utility::string_t& value)
{
m_Photo_url = value;
m_Photo_urlIsSet = true;
}
bool Profile::photoUrlIsSet() const
{
return m_Photo_urlIsSet;
}
void Profile::unsetPhoto_url()
{
m_Photo_urlIsSet = false;
}
utility::string_t Profile::getBannerUrl() const
{
return m_Banner_url;
}
void Profile::setBannerUrl(const utility::string_t& value)
{
m_Banner_url = value;
m_Banner_urlIsSet = true;
}
bool Profile::bannerUrlIsSet() const
{
return m_Banner_urlIsSet;
}
void Profile::unsetBanner_url()
{
m_Banner_urlIsSet = false;
}
utility::datetime Profile::getLastOnline() const
{
return m_Last_online;
}
void Profile::setLastOnline(const utility::datetime& value)
{
m_Last_online = value;
m_Last_onlineIsSet = true;
}
bool Profile::lastOnlineIsSet() const
{
return m_Last_onlineIsSet;
}
void Profile::unsetLast_online()
{
m_Last_onlineIsSet = false;
}
utility::string_t Profile::getBiography() const
{
return m_Biography;
}
void Profile::setBiography(const utility::string_t& value)
{
m_Biography = value;
m_BiographyIsSet = true;
}
bool Profile::biographyIsSet() const
{
return m_BiographyIsSet;
}
void Profile::unsetBiography()
{
m_BiographyIsSet = false;
}
int32_t Profile::getViewCount() const
{
return m_View_count;
}
void Profile::setViewCount(int32_t value)
{
m_View_count = value;
m_View_countIsSet = true;
}
bool Profile::viewCountIsSet() const
{
return m_View_countIsSet;
}
void Profile::unsetView_count()
{
m_View_countIsSet = false;
}
utility::datetime Profile::getCreated() const
{
return m_Created;
}
void Profile::setCreated(const utility::datetime& value)
{
m_Created = value;
m_CreatedIsSet = true;
}
bool Profile::createdIsSet() const
{
return m_CreatedIsSet;
}
void Profile::unsetCreated()
{
m_CreatedIsSet = false;
}
utility::datetime Profile::getUpdated() const
{
return m_Updated;
}
void Profile::setUpdated(const utility::datetime& value)
{
m_Updated = value;
m_UpdatedIsSet = true;
}
bool Profile::updatedIsSet() const
{
return m_UpdatedIsSet;
}
void Profile::unsetUpdated()
{
m_UpdatedIsSet = false;
}
}
}

607
src/model/ProfileGame.cpp Normal file
View File

@ -0,0 +1,607 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/ProfileGame.h"
namespace tribufu {
namespace models {
ProfileGame::ProfileGame()
{
m_Id = utility::conversions::to_string_t("");
m_IdIsSet = false;
m_Name = utility::conversions::to_string_t("");
m_NameIsSet = false;
m_Capsule_image_url = utility::conversions::to_string_t("");
m_Capsule_image_urlIsSet = false;
m_Library_image_url = utility::conversions::to_string_t("");
m_Library_image_urlIsSet = false;
m_Slug = utility::conversions::to_string_t("");
m_SlugIsSet = false;
m_Time_used = 0.0;
m_Time_usedIsSet = false;
m_Unlocked_achievements = 0;
m_Unlocked_achievementsIsSet = false;
m_Total_achievements = 0;
m_Total_achievementsIsSet = false;
m_StatsIsSet = false;
m_Acquired = utility::datetime();
m_AcquiredIsSet = false;
m_Last_used = utility::datetime();
m_Last_usedIsSet = false;
}
ProfileGame::~ProfileGame()
{
}
void ProfileGame::validate()
{
// TODO: implement validation
}
web::json::value ProfileGame::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_Capsule_image_urlIsSet)
{
val[utility::conversions::to_string_t(U("capsule_image_url"))] = ModelBase::toJson(m_Capsule_image_url);
}
if(m_Library_image_urlIsSet)
{
val[utility::conversions::to_string_t(U("library_image_url"))] = ModelBase::toJson(m_Library_image_url);
}
if(m_SlugIsSet)
{
val[utility::conversions::to_string_t(U("slug"))] = ModelBase::toJson(m_Slug);
}
if(m_Time_usedIsSet)
{
val[utility::conversions::to_string_t(U("time_used"))] = ModelBase::toJson(m_Time_used);
}
if(m_Unlocked_achievementsIsSet)
{
val[utility::conversions::to_string_t(U("unlocked_achievements"))] = ModelBase::toJson(m_Unlocked_achievements);
}
if(m_Total_achievementsIsSet)
{
val[utility::conversions::to_string_t(U("total_achievements"))] = ModelBase::toJson(m_Total_achievements);
}
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 ProfileGame::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t(U("id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null())
{
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("capsule_image_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("capsule_image_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setCapsuleImageUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setCapsuleImageUrl);
setCapsuleImageUrl(refVal_setCapsuleImageUrl);
}
}
if(val.has_field(utility::conversions::to_string_t(U("library_image_url"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("library_image_url")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setLibraryImageUrl;
ok &= ModelBase::fromJson(fieldValue, refVal_setLibraryImageUrl);
setLibraryImageUrl(refVal_setLibraryImageUrl);
}
}
if(val.has_field(utility::conversions::to_string_t(U("slug"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("slug")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setSlug;
ok &= ModelBase::fromJson(fieldValue, refVal_setSlug);
setSlug(refVal_setSlug);
}
}
if(val.has_field(utility::conversions::to_string_t(U("time_used"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("time_used")));
if(!fieldValue.is_null())
{
double refVal_setTimeUsed;
ok &= ModelBase::fromJson(fieldValue, refVal_setTimeUsed);
setTimeUsed(refVal_setTimeUsed);
}
}
if(val.has_field(utility::conversions::to_string_t(U("unlocked_achievements"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("unlocked_achievements")));
if(!fieldValue.is_null())
{
int32_t refVal_setUnlockedAchievements;
ok &= ModelBase::fromJson(fieldValue, refVal_setUnlockedAchievements);
setUnlockedAchievements(refVal_setUnlockedAchievements);
}
}
if(val.has_field(utility::conversions::to_string_t(U("total_achievements"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("total_achievements")));
if(!fieldValue.is_null())
{
int32_t refVal_setTotalAchievements;
ok &= ModelBase::fromJson(fieldValue, refVal_setTotalAchievements);
setTotalAchievements(refVal_setTotalAchievements);
}
}
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;
}
void ProfileGame::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_Capsule_image_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("capsule_image_url")), m_Capsule_image_url));
}
if(m_Library_image_urlIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("library_image_url")), m_Library_image_url));
}
if(m_SlugIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("slug")), m_Slug));
}
if(m_Time_usedIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("time_used")), m_Time_used));
}
if(m_Unlocked_achievementsIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("unlocked_achievements")), m_Unlocked_achievements));
}
if(m_Total_achievementsIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("total_achievements")), m_Total_achievements));
}
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 ProfileGame::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("capsule_image_url"))))
{
utility::string_t refVal_setCapsuleImageUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("capsule_image_url"))), refVal_setCapsuleImageUrl );
setCapsuleImageUrl(refVal_setCapsuleImageUrl);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("library_image_url"))))
{
utility::string_t refVal_setLibraryImageUrl;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("library_image_url"))), refVal_setLibraryImageUrl );
setLibraryImageUrl(refVal_setLibraryImageUrl);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("slug"))))
{
utility::string_t refVal_setSlug;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("slug"))), refVal_setSlug );
setSlug(refVal_setSlug);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("time_used"))))
{
double refVal_setTimeUsed;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("time_used"))), refVal_setTimeUsed );
setTimeUsed(refVal_setTimeUsed);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("unlocked_achievements"))))
{
int32_t refVal_setUnlockedAchievements;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("unlocked_achievements"))), refVal_setUnlockedAchievements );
setUnlockedAchievements(refVal_setUnlockedAchievements);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("total_achievements"))))
{
int32_t refVal_setTotalAchievements;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("total_achievements"))), refVal_setTotalAchievements );
setTotalAchievements(refVal_setTotalAchievements);
}
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 ProfileGame::getId() const
{
return m_Id;
}
void ProfileGame::setId(const utility::string_t& value)
{
m_Id = value;
m_IdIsSet = true;
}
bool ProfileGame::idIsSet() const
{
return m_IdIsSet;
}
void ProfileGame::unsetId()
{
m_IdIsSet = false;
}
utility::string_t ProfileGame::getName() const
{
return m_Name;
}
void ProfileGame::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool ProfileGame::nameIsSet() const
{
return m_NameIsSet;
}
void ProfileGame::unsetName()
{
m_NameIsSet = false;
}
utility::string_t ProfileGame::getCapsuleImageUrl() const
{
return m_Capsule_image_url;
}
void ProfileGame::setCapsuleImageUrl(const utility::string_t& value)
{
m_Capsule_image_url = value;
m_Capsule_image_urlIsSet = true;
}
bool ProfileGame::capsuleImageUrlIsSet() const
{
return m_Capsule_image_urlIsSet;
}
void ProfileGame::unsetCapsule_image_url()
{
m_Capsule_image_urlIsSet = false;
}
utility::string_t ProfileGame::getLibraryImageUrl() const
{
return m_Library_image_url;
}
void ProfileGame::setLibraryImageUrl(const utility::string_t& value)
{
m_Library_image_url = value;
m_Library_image_urlIsSet = true;
}
bool ProfileGame::libraryImageUrlIsSet() const
{
return m_Library_image_urlIsSet;
}
void ProfileGame::unsetLibrary_image_url()
{
m_Library_image_urlIsSet = false;
}
utility::string_t ProfileGame::getSlug() const
{
return m_Slug;
}
void ProfileGame::setSlug(const utility::string_t& value)
{
m_Slug = value;
m_SlugIsSet = true;
}
bool ProfileGame::slugIsSet() const
{
return m_SlugIsSet;
}
void ProfileGame::unsetSlug()
{
m_SlugIsSet = false;
}
double ProfileGame::getTimeUsed() const
{
return m_Time_used;
}
void ProfileGame::setTimeUsed(double value)
{
m_Time_used = value;
m_Time_usedIsSet = true;
}
bool ProfileGame::timeUsedIsSet() const
{
return m_Time_usedIsSet;
}
void ProfileGame::unsetTime_used()
{
m_Time_usedIsSet = false;
}
int32_t ProfileGame::getUnlockedAchievements() const
{
return m_Unlocked_achievements;
}
void ProfileGame::setUnlockedAchievements(int32_t value)
{
m_Unlocked_achievements = value;
m_Unlocked_achievementsIsSet = true;
}
bool ProfileGame::unlockedAchievementsIsSet() const
{
return m_Unlocked_achievementsIsSet;
}
void ProfileGame::unsetUnlocked_achievements()
{
m_Unlocked_achievementsIsSet = false;
}
int32_t ProfileGame::getTotalAchievements() const
{
return m_Total_achievements;
}
void ProfileGame::setTotalAchievements(int32_t value)
{
m_Total_achievements = value;
m_Total_achievementsIsSet = true;
}
bool ProfileGame::totalAchievementsIsSet() const
{
return m_Total_achievementsIsSet;
}
void ProfileGame::unsetTotal_achievements()
{
m_Total_achievementsIsSet = false;
}
std::shared_ptr<AnyType> ProfileGame::getStats() const
{
return m_Stats;
}
void ProfileGame::setStats(const std::shared_ptr<AnyType>& value)
{
m_Stats = value;
m_StatsIsSet = true;
}
bool ProfileGame::statsIsSet() const
{
return m_StatsIsSet;
}
void ProfileGame::unsetStats()
{
m_StatsIsSet = false;
}
utility::datetime ProfileGame::getAcquired() const
{
return m_Acquired;
}
void ProfileGame::setAcquired(const utility::datetime& value)
{
m_Acquired = value;
m_AcquiredIsSet = true;
}
bool ProfileGame::acquiredIsSet() const
{
return m_AcquiredIsSet;
}
void ProfileGame::unsetAcquired()
{
m_AcquiredIsSet = false;
}
utility::datetime ProfileGame::getLastUsed() const
{
return m_Last_used;
}
void ProfileGame::setLastUsed(const utility::datetime& value)
{
m_Last_used = value;
m_Last_usedIsSet = true;
}
bool ProfileGame::lastUsedIsSet() const
{
return m_Last_usedIsSet;
}
void ProfileGame::unsetLast_used()
{
m_Last_usedIsSet = false;
}
}
}

558
src/model/ProfileGroup.cpp Normal file
View File

@ -0,0 +1,558 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/ProfileGroup.h"
namespace tribufu {
namespace models {
ProfileGroup::ProfileGroup()
{
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_Tag = utility::conversions::to_string_t("");
m_TagIsSet = false;
m_Privacy = 0;
m_PrivacyIsSet = false;
m_Verified = false;
m_VerifiedIsSet = false;
m_Photo_url = utility::conversions::to_string_t("");
m_Photo_urlIsSet = false;
m_Member_count = 0;
m_Member_countIsSet = false;
m_RankIsSet = false;
m_Since = utility::datetime();
m_SinceIsSet = false;
}
ProfileGroup::~ProfileGroup()
{
}
void ProfileGroup::validate()
{
// TODO: implement validation
}
web::json::value ProfileGroup::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_TagIsSet)
{
val[utility::conversions::to_string_t(U("tag"))] = ModelBase::toJson(m_Tag);
}
if(m_PrivacyIsSet)
{
val[utility::conversions::to_string_t(U("privacy"))] = ModelBase::toJson(m_Privacy);
}
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_Member_countIsSet)
{
val[utility::conversions::to_string_t(U("member_count"))] = ModelBase::toJson(m_Member_count);
}
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 ProfileGroup::fromJson(const web::json::value& val)
{
bool ok = true;
if(val.has_field(utility::conversions::to_string_t(U("id"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null())
{
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("tag"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tag")));
if(!fieldValue.is_null())
{
utility::string_t refVal_setTag;
ok &= ModelBase::fromJson(fieldValue, refVal_setTag);
setTag(refVal_setTag);
}
}
if(val.has_field(utility::conversions::to_string_t(U("privacy"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("privacy")));
if(!fieldValue.is_null())
{
int32_t refVal_setPrivacy;
ok &= ModelBase::fromJson(fieldValue, refVal_setPrivacy);
setPrivacy(refVal_setPrivacy);
}
}
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("member_count"))))
{
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("member_count")));
if(!fieldValue.is_null())
{
int32_t refVal_setMemberCount;
ok &= ModelBase::fromJson(fieldValue, refVal_setMemberCount);
setMemberCount(refVal_setMemberCount);
}
}
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;
}
void ProfileGroup::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_TagIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("tag")), m_Tag));
}
if(m_PrivacyIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("privacy")), m_Privacy));
}
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_Member_countIsSet)
{
multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("member_count")), m_Member_count));
}
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 ProfileGroup::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("tag"))))
{
utility::string_t refVal_setTag;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tag"))), refVal_setTag );
setTag(refVal_setTag);
}
if(multipart->hasContent(utility::conversions::to_string_t(U("privacy"))))
{
int32_t refVal_setPrivacy;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("privacy"))), refVal_setPrivacy );
setPrivacy(refVal_setPrivacy);
}
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("member_count"))))
{
int32_t refVal_setMemberCount;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("member_count"))), refVal_setMemberCount );
setMemberCount(refVal_setMemberCount);
}
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 ProfileGroup::getId() const
{
return m_Id;
}
void ProfileGroup::setId(const utility::string_t& value)
{
m_Id = value;
m_IdIsSet = true;
}
bool ProfileGroup::idIsSet() const
{
return m_IdIsSet;
}
void ProfileGroup::unsetId()
{
m_IdIsSet = false;
}
utility::string_t ProfileGroup::getUuid() const
{
return m_Uuid;
}
void ProfileGroup::setUuid(const utility::string_t& value)
{
m_Uuid = value;
m_UuidIsSet = true;
}
bool ProfileGroup::uuidIsSet() const
{
return m_UuidIsSet;
}
void ProfileGroup::unsetUuid()
{
m_UuidIsSet = false;
}
utility::string_t ProfileGroup::getName() const
{
return m_Name;
}
void ProfileGroup::setName(const utility::string_t& value)
{
m_Name = value;
m_NameIsSet = true;
}
bool ProfileGroup::nameIsSet() const
{
return m_NameIsSet;
}
void ProfileGroup::unsetName()
{
m_NameIsSet = false;
}
utility::string_t ProfileGroup::getTag() const
{
return m_Tag;
}
void ProfileGroup::setTag(const utility::string_t& value)
{
m_Tag = value;
m_TagIsSet = true;
}
bool ProfileGroup::tagIsSet() const
{
return m_TagIsSet;
}
void ProfileGroup::unsetTag()
{
m_TagIsSet = false;
}
int32_t ProfileGroup::getPrivacy() const
{
return m_Privacy;
}
void ProfileGroup::setPrivacy(int32_t value)
{
m_Privacy = value;
m_PrivacyIsSet = true;
}
bool ProfileGroup::privacyIsSet() const
{
return m_PrivacyIsSet;
}
void ProfileGroup::unsetPrivacy()
{
m_PrivacyIsSet = false;
}
bool ProfileGroup::isVerified() const
{
return m_Verified;
}
void ProfileGroup::setVerified(bool value)
{
m_Verified = value;
m_VerifiedIsSet = true;
}
bool ProfileGroup::verifiedIsSet() const
{
return m_VerifiedIsSet;
}
void ProfileGroup::unsetVerified()
{
m_VerifiedIsSet = false;
}
utility::string_t ProfileGroup::getPhotoUrl() const
{
return m_Photo_url;
}
void ProfileGroup::setPhotoUrl(const utility::string_t& value)
{
m_Photo_url = value;
m_Photo_urlIsSet = true;
}
bool ProfileGroup::photoUrlIsSet() const
{
return m_Photo_urlIsSet;
}
void ProfileGroup::unsetPhoto_url()
{
m_Photo_urlIsSet = false;
}
int32_t ProfileGroup::getMemberCount() const
{
return m_Member_count;
}
void ProfileGroup::setMemberCount(int32_t value)
{
m_Member_count = value;
m_Member_countIsSet = true;
}
bool ProfileGroup::memberCountIsSet() const
{
return m_Member_countIsSet;
}
void ProfileGroup::unsetMember_count()
{
m_Member_countIsSet = false;
}
std::shared_ptr<GroupRank> ProfileGroup::getRank() const
{
return m_Rank;
}
void ProfileGroup::setRank(const std::shared_ptr<GroupRank>& value)
{
m_Rank = value;
m_RankIsSet = true;
}
bool ProfileGroup::rankIsSet() const
{
return m_RankIsSet;
}
void ProfileGroup::unsetRank()
{
m_RankIsSet = false;
}
utility::datetime ProfileGroup::getSince() const
{
return m_Since;
}
void ProfileGroup::setSince(const utility::datetime& value)
{
m_Since = value;
m_SinceIsSet = true;
}
bool ProfileGroup::sinceIsSet() const
{
return m_SinceIsSet;
}
void ProfileGroup::unsetSince()
{
m_SinceIsSet = false;
}
}
}

View File

@ -0,0 +1,121 @@
/**
* Tribufu API
* REST API to access Tribufu services.
*
* The version of the OpenAPI document: 1.1.0
* Contact: contact@tribufu.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.12.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "tribufu++/model/RefreshRequest.h"
namespace tribufu {
namespace models {
RefreshRequest::RefreshRequest()
{
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;
}
}
}

Some files were not shown because too many files have changed in this diff Show More