Page MenuHomePhorge

whoami.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

whoami.cpp

/******************************************************************************
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
*/
#include <algorithm>
#include "whoami.hpp"
namespace Kazv
{
BaseJob::Query GetTokenOwnerJob::buildQuery(
)
{
BaseJob::Query _q;
return _q;
}
BaseJob::Body GetTokenOwnerJob::buildBody()
{
// ignore unused param
return BaseJob::EmptyBody{};
};
GetTokenOwnerJob::GetTokenOwnerJob(
std::string serverUrl
, std::string _accessToken
)
: BaseJob(std::move(serverUrl),
std::string("/_matrix/client/r0") + "/account/whoami",
GET,
std::string("GetTokenOwner"),
_accessToken,
ReturnType::Json,
buildBody()
, buildQuery()
)
{
}
GetTokenOwnerJob GetTokenOwnerJob::withData(JsonWrap j) &&
{
auto ret = GetTokenOwnerJob(std::move(*this));
ret.attachData(j);
return ret;
}
GetTokenOwnerJob GetTokenOwnerJob::withData(JsonWrap j) const &
{
auto ret = GetTokenOwnerJob(*this);
ret.attachData(j);
return ret;
}
GetTokenOwnerJob::JobResponse::JobResponse(Response r)
: Response(std::move(r)) {}
bool GetTokenOwnerResponse::success() const
{
return Response::success()
&& isBodyJson(body)
&& jsonBody().get().contains("user_id"s)
;
}
std::string GetTokenOwnerResponse::userId() const
{
if (jsonBody().get()
.contains("user_id"s)) {
return
jsonBody().get()["user_id"s]
/*.get<std::string>()*/;}
else { return std::string( );}
}
}

File Metadata

Mime Type
text/x-c++
Expires
Tue, Jun 24, 5:56 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
234966
Default Alt Text
whoami.cpp (1 KB)

Event Timeline