nyanimedb/modules/bot/back/include/BotToServer.hpp

35 lines
No EOL
1.2 KiB
C++

#pragma once
#include "CppRestOpenAPIClient/ApiClient.h"
#include "CppRestOpenAPIClient/ApiConfiguration.h"
#include "CppRestOpenAPIClient/api/DefaultApi.h"
#include "CppRestOpenAPIClient/model/User.h"
#include "CppRestOpenAPIClient/model/GetUserTitles_200_response.h"
#include "CppRestOpenAPIClient/model/UserTitle.h"
#include "CppRestOpenAPIClient/model/Title.h"
#include "constants.hpp"
#include "structs.hpp"
#include <iostream>
#include <thread>
#include <functional>
#include <memory>
#include <cpprest/asyncrt_utils.h>
#include <boost/optional.hpp>
#include "AuthImpersonation.hpp"
using namespace org::openapitools::client::api;
class BotToServer {
public:
BotToServer();
// Асинхронный метод: получить список тайтлов пользователя
pplx::task<std::vector<BotStructs::Title>> fetchUserTitlesAsync(const std::string& userId);
private:
std::shared_ptr<org::openapitools::client::api::ApiConfiguration> apiconfiguration;
std::shared_ptr<org::openapitools::client::api::ApiClient> apiclient;
std::shared_ptr<org::openapitools::client::api::DefaultApi> api;
nyanimed::AuthImpersonationClient authClient;
};