code format
This commit is contained in:
@@ -8,22 +8,21 @@
|
||||
namespace CocoaTweet::API {
|
||||
API::API(CocoaTweet::Authentication::Key _key) {
|
||||
swapKey(_key);
|
||||
|
||||
}
|
||||
|
||||
void API::swapKey(const CocoaTweet::Authentication::Key _key){
|
||||
if(_key.authType() == CocoaTweet::Authentication::Key::OAUTH10A){
|
||||
oauth_ = std::make_shared<CocoaTweet::Authentication::OAuth1>(_key);
|
||||
}else if(_key.authType() == CocoaTweet::Authentication::Key::OAUTH2){
|
||||
oauth_ = std::make_shared<CocoaTweet::Authentication::Bearer>(_key);
|
||||
void API::swapKey(const CocoaTweet::Authentication::Key _key) {
|
||||
if (_key.authType() == CocoaTweet::Authentication::Key::OAUTH10A) {
|
||||
oauth_ = std::make_shared<CocoaTweet::Authentication::OAuth1>(_key);
|
||||
} else if (_key.authType() == CocoaTweet::Authentication::Key::OAUTH2) {
|
||||
oauth_ = std::make_shared<CocoaTweet::Authentication::Bearer>(_key);
|
||||
}
|
||||
user_ = Users::User(oauth_);
|
||||
status_ = Statuses::Status(oauth_);
|
||||
favorite_ = Favorites::Favorite(oauth_);
|
||||
media_ = Medias::Media(oauth_);
|
||||
directMessage_ = DirectMessages::DirectMessage(oauth_);
|
||||
oauth1_ = OAuth1::OAuth(oauth_);
|
||||
oauth2_ = OAuth2::OAuth2(oauth_);
|
||||
oauth1_ = OAuth1::OAuth(oauth_);
|
||||
oauth2_ = OAuth2::OAuth2(oauth_);
|
||||
}
|
||||
|
||||
// const std::string& API::generateBearerToken() const {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
#include <cocoatweet/api/directMessage/new.h>
|
||||
|
||||
namespace CocoaTweet::API::DirectMessages {
|
||||
DirectMessage::DirectMessage(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
DirectMessage::DirectMessage(
|
||||
std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
oauth_ = _oauth;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ public:
|
||||
DirectMessage() = default;
|
||||
|
||||
/// @brief constructor which finally should to be called.
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to OAuth object
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to
|
||||
/// OAuth object
|
||||
DirectMessage(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
void messageCreate(const std::string& _recipient, const std::string& _message);
|
||||
|
||||
@@ -17,7 +17,8 @@ public:
|
||||
void message(const std::string& _message);
|
||||
|
||||
/// @brief process request for endpoint
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to oauth object
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to oauth object
|
||||
/// @param[out] CocoaTweet::API::Model::Tweet : request result
|
||||
void process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ void Create::id(const std::string& _id) {
|
||||
bodyParam_.insert_or_assign("id", _id);
|
||||
}
|
||||
|
||||
CocoaTweet::API::Model::Tweet Create::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
CocoaTweet::API::Model::Tweet Create::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
CocoaTweet::API::Model::Tweet tweet;
|
||||
HttpPost::process(_oauth, [&tweet](const std::string& _rcv) {
|
||||
tweet = CocoaTweet::API::Model::Tweet(_rcv);
|
||||
|
||||
@@ -9,7 +9,8 @@ class Create : public CocoaTweet::API::Interface::HttpPost {
|
||||
public:
|
||||
Create();
|
||||
void id(const std::string& _id);
|
||||
CocoaTweet::API::Model::Tweet process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
CocoaTweet::API::Model::Tweet process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -9,7 +9,8 @@ class Destroy : public CocoaTweet::API::Interface::HttpPost {
|
||||
public:
|
||||
Destroy();
|
||||
void id(const std::string& _id);
|
||||
CocoaTweet::API::Model::Tweet process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
CocoaTweet::API::Model::Tweet process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -109,7 +109,7 @@ void HttpGet::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBas
|
||||
std::cout << rcv << std::endl;
|
||||
#endif
|
||||
if ((responseCode / 100) == 4) {
|
||||
auto j = nlohmann::json::parse(rcv);
|
||||
auto j = nlohmann::json::parse(rcv);
|
||||
if (j.count("error") != 0) {
|
||||
// この形式はエラーコードを持たないのでエラー種別が特定できない
|
||||
throw new CocoaTweet::Exception::Exception(j["error"]);
|
||||
@@ -117,7 +117,7 @@ void HttpGet::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBas
|
||||
|
||||
auto error = j["errors"][0]["code"];
|
||||
auto message = j["errors"][0]["message"];
|
||||
|
||||
|
||||
if (error.get<int>() == 144) {
|
||||
throw CocoaTweet::Exception::TweetNotFoundException(message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 32) {
|
||||
@@ -130,10 +130,12 @@ void HttpGet::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBas
|
||||
throw CocoaTweet::Exception::RateLimitException(message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 186) {
|
||||
throw CocoaTweet::Exception::TweetTooLongException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 170){
|
||||
throw CocoaTweet::Exception::MissingRequiredParamException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 220){
|
||||
throw CocoaTweet::Exception::CredentialNotAllowedException(message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 170) {
|
||||
throw CocoaTweet::Exception::MissingRequiredParamException(
|
||||
message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 220) {
|
||||
throw CocoaTweet::Exception::CredentialNotAllowedException(
|
||||
message.get<std::string>().c_str());
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ class HttpGet : public virtual HttpBase {
|
||||
public:
|
||||
protected:
|
||||
/// @brief Send HTTP/POST using OAuth object
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to OAuth object to
|
||||
/// authenticate
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to OAuth object to authenticate
|
||||
/// @param[in] std::function<void(const unsigned int, const std::string&)> _callback :
|
||||
/// callback method for processing to response
|
||||
void process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth,
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace CocoaTweet::API::Interface {
|
||||
void HttpPost::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth,
|
||||
std::function<void(const std::string&)> _callback) {
|
||||
// エンドポイントへのパラメータにOAuthパラメータを付加して署名作成
|
||||
auto oauth = _oauth.lock();
|
||||
auto oauth = _oauth.lock();
|
||||
// auto oauthParam = oauth->oauthParam();
|
||||
// auto sigingParam = oauthParam;
|
||||
// if (contentType_ == "application/x-www-form-urlencoded") {
|
||||
@@ -71,7 +71,6 @@ void HttpPost::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBa
|
||||
// oauthHeader += CocoaTweet::Util::join(tmp, ",");
|
||||
// }
|
||||
|
||||
|
||||
auto oauthHeader = std::string();
|
||||
if (contentType_ == "application/x-www-form-urlencoded") {
|
||||
oauthHeader = oauth->calculateAuthHeader(bodyParam_, "POST", url_);
|
||||
@@ -128,12 +127,12 @@ void HttpPost::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBa
|
||||
std::cout << rcv << std::endl;
|
||||
#endif
|
||||
if ((responseCode / 100) == 4) {
|
||||
auto j = nlohmann::json::parse(rcv);
|
||||
auto j = nlohmann::json::parse(rcv);
|
||||
if (j.count("error") != 0) {
|
||||
// この形式はエラーコードを持たないのでエラー種別が特定できない
|
||||
throw new CocoaTweet::Exception::Exception(j["error"]);
|
||||
}
|
||||
|
||||
|
||||
auto error = j["errors"][0]["code"];
|
||||
auto message = j["errors"][0]["message"];
|
||||
if (error.get<int>() == 144) {
|
||||
@@ -148,10 +147,12 @@ void HttpPost::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBa
|
||||
throw CocoaTweet::Exception::RateLimitException(message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 186) {
|
||||
throw CocoaTweet::Exception::TweetTooLongException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 170){
|
||||
throw CocoaTweet::Exception::MissingRequiredParamException(message.get<std::string>().c_str());
|
||||
}else if(error.get<int>() == 220){
|
||||
throw CocoaTweet::Exception::CredentialNotAllowedException(message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 170) {
|
||||
throw CocoaTweet::Exception::MissingRequiredParamException(
|
||||
message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 220) {
|
||||
throw CocoaTweet::Exception::CredentialNotAllowedException(
|
||||
message.get<std::string>().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ class HttpPost : public HttpBase {
|
||||
public:
|
||||
protected:
|
||||
/// @brief Send HTTP/POST using OAuth object
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to OAuth object to
|
||||
/// authenticate
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to OAuth object to authenticate
|
||||
/// @param[in] std::function<void(const unsigned int, const std::string&)> _callback :
|
||||
/// callback method for processing to response
|
||||
void process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth,
|
||||
|
||||
@@ -16,7 +16,8 @@ public:
|
||||
Media() = default;
|
||||
|
||||
/// @brief constructor which finally should to be called.
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to OAuth object
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to
|
||||
/// OAuth object
|
||||
Media(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
CocoaTweet::API::Model::MediaStore upload(const std::string& _file) const;
|
||||
|
||||
@@ -26,11 +26,12 @@ public:
|
||||
void mediaId(const std::string& _mediaId);
|
||||
|
||||
/// @brief upload media
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to OAuth object for
|
||||
/// authenticate
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to OAuth object for authenticate
|
||||
/// @param[out] CocoaTweet::API::Model::MediaStore : media upload result. use id() for post
|
||||
/// tweet.
|
||||
CocoaTweet::API::Model::MediaStore process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
CocoaTweet::API::Model::MediaStore process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
} // namespace CocoaTweet::API::Medias
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
#include "oauthToken.h"
|
||||
|
||||
namespace CocoaTweet::API::Model{
|
||||
namespace CocoaTweet::API::Model {
|
||||
|
||||
OAuthToken::OAuthToken(): oauthToken_(""), oauthTokenSecret_(""){}
|
||||
OAuthToken::OAuthToken(const std::string _oauthToken, const std::string& _oauthTokenSecret): oauthToken_(_oauthToken), oauthTokenSecret_(_oauthTokenSecret) {}
|
||||
const std::string& OAuthToken::oauthToken() const {
|
||||
return oauthToken_;
|
||||
}
|
||||
const std::string& OAuthToken::oauthTokenSecret() const{
|
||||
return oauthTokenSecret_;
|
||||
}
|
||||
void OAuthToken::oauthToken(const std::string& _oauthToken) {
|
||||
oauthToken_ = _oauthToken;
|
||||
}
|
||||
void OAuthToken::oauthTokenSecret(const std::string& _oauthTokenSecret){
|
||||
oauthTokenSecret_ = _oauthTokenSecret;
|
||||
}
|
||||
}
|
||||
OAuthToken::OAuthToken() : oauthToken_(""), oauthTokenSecret_("") {}
|
||||
OAuthToken::OAuthToken(const std::string _oauthToken, const std::string& _oauthTokenSecret)
|
||||
: oauthToken_(_oauthToken), oauthTokenSecret_(_oauthTokenSecret) {}
|
||||
const std::string& OAuthToken::oauthToken() const {
|
||||
return oauthToken_;
|
||||
}
|
||||
const std::string& OAuthToken::oauthTokenSecret() const {
|
||||
return oauthTokenSecret_;
|
||||
}
|
||||
void OAuthToken::oauthToken(const std::string& _oauthToken) {
|
||||
oauthToken_ = _oauthToken;
|
||||
}
|
||||
void OAuthToken::oauthTokenSecret(const std::string& _oauthTokenSecret) {
|
||||
oauthTokenSecret_ = _oauthTokenSecret;
|
||||
}
|
||||
} // namespace CocoaTweet::API::Model
|
||||
@@ -1,20 +1,20 @@
|
||||
#ifndef COCOATWEET_API_MODEL_OAUTHTOKEN_H_
|
||||
#define COCOATWEET_API_MODEL_OAUTHTOKEN_H_
|
||||
#include<string>
|
||||
#include <string>
|
||||
|
||||
namespace CocoaTweet::API::Model{
|
||||
class OAuthToken{
|
||||
std::string oauthToken_;
|
||||
std::string oauthTokenSecret_;
|
||||
namespace CocoaTweet::API::Model {
|
||||
class OAuthToken {
|
||||
std::string oauthToken_;
|
||||
std::string oauthTokenSecret_;
|
||||
|
||||
public:
|
||||
OAuthToken();
|
||||
OAuthToken(const std::string _oauthToken, const std::string& _oauthTokenSecret);
|
||||
const std::string& oauthToken() const;
|
||||
const std::string& oauthTokenSecret() const;
|
||||
void oauthToken(const std::string& _oauthToken);
|
||||
void oauthTokenSecret(const std::string& _oauthTokenSecret);
|
||||
};
|
||||
}
|
||||
public:
|
||||
OAuthToken();
|
||||
OAuthToken(const std::string _oauthToken, const std::string& _oauthTokenSecret);
|
||||
const std::string& oauthToken() const;
|
||||
const std::string& oauthTokenSecret() const;
|
||||
void oauthToken(const std::string& _oauthToken);
|
||||
void oauthTokenSecret(const std::string& _oauthTokenSecret);
|
||||
};
|
||||
} // namespace CocoaTweet::API::Model
|
||||
|
||||
#endif
|
||||
@@ -2,32 +2,33 @@
|
||||
#include <cocoatweet/util/util.h>
|
||||
#include <iostream>
|
||||
|
||||
namespace CocoaTweet::API::OAuth1{
|
||||
AccessToken::AccessToken(){
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth/access_token";
|
||||
}
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
AccessToken::AccessToken() {
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth/access_token";
|
||||
}
|
||||
|
||||
void AccessToken::oauthVerifier(const std::string& _verifier){
|
||||
bodyParam_.insert_or_assign("oauth_verifier", _verifier);
|
||||
}
|
||||
void AccessToken::oauthVerifier(const std::string& _verifier) {
|
||||
bodyParam_.insert_or_assign("oauth_verifier", _verifier);
|
||||
}
|
||||
|
||||
void AccessToken::oauthToken(const CocoaTweet::API::Model::OAuthToken _token){
|
||||
oauthToken_ = _token;
|
||||
}
|
||||
void AccessToken::oauthToken(const CocoaTweet::API::Model::OAuthToken _token) {
|
||||
oauthToken_ = _token;
|
||||
}
|
||||
|
||||
const CocoaTweet::API::Model::OAuthToken AccessToken::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth){
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken;
|
||||
HttpPost::process(_oauth, [&oauthToken](const std::string& _rcv){
|
||||
auto mp = CocoaTweet::Util::parse(_rcv, '&', '=');
|
||||
if(mp.count("oauth_token")){
|
||||
oauthToken.oauthToken(mp.at("oauth_token"));
|
||||
}
|
||||
if(mp.count("oauth_token_secret")){
|
||||
oauthToken.oauthTokenSecret(mp.at("oauth_token_secret"));
|
||||
}
|
||||
std::cout << _rcv << std::endl;
|
||||
});
|
||||
return oauthToken;
|
||||
const CocoaTweet::API::Model::OAuthToken AccessToken::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken;
|
||||
HttpPost::process(_oauth, [&oauthToken](const std::string& _rcv) {
|
||||
auto mp = CocoaTweet::Util::parse(_rcv, '&', '=');
|
||||
if (mp.count("oauth_token")) {
|
||||
oauthToken.oauthToken(mp.at("oauth_token"));
|
||||
}
|
||||
}
|
||||
if (mp.count("oauth_token_secret")) {
|
||||
oauthToken.oauthTokenSecret(mp.at("oauth_token_secret"));
|
||||
}
|
||||
std::cout << _rcv << std::endl;
|
||||
});
|
||||
return oauthToken;
|
||||
}
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
@@ -3,18 +3,20 @@
|
||||
|
||||
#include <cocoatweet/api/interface/httpPost.h>
|
||||
#include <cocoatweet/api/model/oauthToken.h>
|
||||
namespace CocoaTweet::API::OAuth1{
|
||||
class AccessToken: public CocoaTweet::API::Interface::HttpPost {
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
class AccessToken : public CocoaTweet::API::Interface::HttpPost {
|
||||
private:
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken_;
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken_;
|
||||
|
||||
public:
|
||||
AccessToken();
|
||||
AccessToken();
|
||||
|
||||
void oauthVerifier(const std::string& _verifier);
|
||||
void oauthToken(const CocoaTweet::API::Model::OAuthToken _token);
|
||||
void oauthVerifier(const std::string& _verifier);
|
||||
void oauthToken(const CocoaTweet::API::Model::OAuthToken _token);
|
||||
|
||||
const CocoaTweet::API::Model::OAuthToken process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) ;
|
||||
};
|
||||
}
|
||||
const CocoaTweet::API::Model::OAuthToken process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
|
||||
#endif
|
||||
@@ -3,31 +3,33 @@
|
||||
#include <iostream>
|
||||
#include <cocoatweet/util/util.h>
|
||||
|
||||
namespace CocoaTweet::API::OAuth1{
|
||||
Authorize::Authorize(){
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth/authorize";
|
||||
}
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
Authorize::Authorize() {
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth/authorize";
|
||||
}
|
||||
|
||||
void Authorize::oauthToken(const std::string& _oauthToken){
|
||||
bodyParam_.insert_or_assign("oauth_token", _oauthToken);
|
||||
}
|
||||
void Authorize::oauthToken(const std::string& _oauthToken) {
|
||||
bodyParam_.insert_or_assign("oauth_token", _oauthToken);
|
||||
}
|
||||
|
||||
void Authorize::forceLogin(const bool _forceLogin){
|
||||
bodyParam_.insert_or_assign("force_login", std::to_string(static_cast<int>(_forceLogin)));
|
||||
}
|
||||
void Authorize::forceLogin(const bool _forceLogin) {
|
||||
bodyParam_.insert_or_assign("force_login", std::to_string(static_cast<int>(_forceLogin)));
|
||||
}
|
||||
|
||||
void Authorize::screenName(const std::string& _screenName){
|
||||
bodyParam_.insert_or_assign("screen_name", _screenName);
|
||||
}
|
||||
void Authorize::screenName(const std::string& _screenName) {
|
||||
bodyParam_.insert_or_assign("screen_name", _screenName);
|
||||
}
|
||||
|
||||
const std::string Authorize::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> __unused__) {
|
||||
std::vector<std::string> tmp;
|
||||
std::string query = "";
|
||||
for (const auto& [key, value] : bodyParam_) {
|
||||
tmp.push_back(key + "=" + value);
|
||||
query = CocoaTweet::Util::join(tmp, "&");
|
||||
}
|
||||
return url_ + "?" + query;;
|
||||
}
|
||||
}
|
||||
const std::string Authorize::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> __unused__) {
|
||||
std::vector<std::string> tmp;
|
||||
std::string query = "";
|
||||
for (const auto& [key, value] : bodyParam_) {
|
||||
tmp.push_back(key + "=" + value);
|
||||
query = CocoaTweet::Util::join(tmp, "&");
|
||||
}
|
||||
return url_ + "?" + query;
|
||||
;
|
||||
}
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
@@ -2,19 +2,20 @@
|
||||
#define COCOATWEET_API_OAUTH1_AUTHORIZE_H
|
||||
|
||||
#include <cocoatweet/api/interface/httpPost.h>
|
||||
namespace CocoaTweet::API::OAuth1{
|
||||
class Authorize: public CocoaTweet::API::Interface::HttpPost {
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
class Authorize : public CocoaTweet::API::Interface::HttpPost {
|
||||
public:
|
||||
Authorize();
|
||||
Authorize();
|
||||
|
||||
void oauthToken(const std::string& _oauthToken);
|
||||
void oauthToken(const std::string& _oauthToken);
|
||||
|
||||
void forceLogin(const bool _forceLogin);
|
||||
void forceLogin(const bool _forceLogin);
|
||||
|
||||
void screenName(const std::string& _screenName);
|
||||
void screenName(const std::string& _screenName);
|
||||
|
||||
const std::string process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> __unused__) ;
|
||||
};
|
||||
}
|
||||
const std::string process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> __unused__);
|
||||
};
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
|
||||
#endif
|
||||
@@ -2,34 +2,36 @@
|
||||
#include <cocoatweet/authentication/authenticate.h>
|
||||
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
OAuth::OAuth(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth){
|
||||
oauth_ = _oauth;
|
||||
}
|
||||
OAuth::OAuth(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
oauth_ = _oauth;
|
||||
}
|
||||
|
||||
CocoaTweet::API::Model::OAuthToken OAuth::requestToken(const std::string& _oauthCallback) const{
|
||||
auto key = oauth_.lock()->key();
|
||||
key.authType(CocoaTweet::Authentication::Key::AUTH_TYPE::OAUTH10A);
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::OAuth1>(key);
|
||||
CocoaTweet::API::Model::OAuthToken OAuth::requestToken(
|
||||
const std::string& _oauthCallback) const {
|
||||
auto key = oauth_.lock()->key();
|
||||
key.authType(CocoaTweet::Authentication::Key::AUTH_TYPE::OAUTH10A);
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::OAuth1>(key);
|
||||
|
||||
CocoaTweet::API::OAuth1::RequestToken requestToken;
|
||||
requestToken.oauthCallback(_oauthCallback);
|
||||
return requestToken.process(oauth);
|
||||
}
|
||||
CocoaTweet::API::OAuth1::RequestToken requestToken;
|
||||
requestToken.oauthCallback(_oauthCallback);
|
||||
return requestToken.process(oauth);
|
||||
}
|
||||
|
||||
const std::string OAuth::authorize(const CocoaTweet::API::Model::OAuthToken _oauthToken) const{
|
||||
CocoaTweet::API::OAuth1::Authorize authorize;
|
||||
authorize.oauthToken(_oauthToken.oauthToken());
|
||||
return authorize.process(oauth_);
|
||||
}
|
||||
const std::string OAuth::authorize(const CocoaTweet::API::Model::OAuthToken _oauthToken) const {
|
||||
CocoaTweet::API::OAuth1::Authorize authorize;
|
||||
authorize.oauthToken(_oauthToken.oauthToken());
|
||||
return authorize.process(oauth_);
|
||||
}
|
||||
|
||||
const CocoaTweet::API::Model::OAuthToken OAuth::accessToken(const CocoaTweet::API::Model::OAuthToken _oauthToken, const std::string _verifier) const{
|
||||
auto key = oauth_.lock()->key();
|
||||
key.authType(CocoaTweet::Authentication::Key::AUTH_TYPE::OAUTH10A);
|
||||
key.accessToken(_oauthToken.oauthToken());
|
||||
key.accessTokenSecret(_oauthToken.oauthTokenSecret());
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::OAuth1>(key);
|
||||
CocoaTweet::API::OAuth1::AccessToken accessToken;
|
||||
accessToken.oauthVerifier(_verifier);
|
||||
return accessToken.process(oauth);
|
||||
}
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
const CocoaTweet::API::Model::OAuthToken OAuth::accessToken(
|
||||
const CocoaTweet::API::Model::OAuthToken _oauthToken, const std::string _verifier) const {
|
||||
auto key = oauth_.lock()->key();
|
||||
key.authType(CocoaTweet::Authentication::Key::AUTH_TYPE::OAUTH10A);
|
||||
key.accessToken(_oauthToken.oauthToken());
|
||||
key.accessTokenSecret(_oauthToken.oauthTokenSecret());
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::OAuth1>(key);
|
||||
CocoaTweet::API::OAuth1::AccessToken accessToken;
|
||||
accessToken.oauthVerifier(_verifier);
|
||||
return accessToken.process(oauth);
|
||||
}
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
|
||||
@@ -15,16 +15,17 @@ class OAuth : public groupInterface {
|
||||
public:
|
||||
/// @brief primary constructor
|
||||
OAuth() = default;
|
||||
|
||||
|
||||
/// @brief constructor which finally should to be called.
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to OAuth object
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to
|
||||
/// OAuth object
|
||||
OAuth(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
CocoaTweet::API::Model::OAuthToken requestToken(const std::string& _oauthCallback) const;
|
||||
const std::string authorize(const CocoaTweet::API::Model::OAuthToken _oauthToken) const;
|
||||
const CocoaTweet::API::Model::OAuthToken accessToken(const CocoaTweet::API::Model::OAuthToken _oauthToken, const std::string _verifier) const;
|
||||
|
||||
const CocoaTweet::API::Model::OAuthToken accessToken(
|
||||
const CocoaTweet::API::Model::OAuthToken _oauthToken, const std::string _verifier) const;
|
||||
};
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,28 +2,29 @@
|
||||
#include <cocoatweet/util/util.h>
|
||||
#include <iostream>
|
||||
|
||||
namespace CocoaTweet::API::OAuth1{
|
||||
RequestToken::RequestToken(){
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth/request_token";
|
||||
}
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
RequestToken::RequestToken() {
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth/request_token";
|
||||
}
|
||||
|
||||
void RequestToken::oauthCallback(const std::string& _oauthCallback){
|
||||
bodyParam_.insert_or_assign("oauth_callback", _oauthCallback);
|
||||
}
|
||||
void RequestToken::oauthCallback(const std::string& _oauthCallback) {
|
||||
bodyParam_.insert_or_assign("oauth_callback", _oauthCallback);
|
||||
}
|
||||
|
||||
CocoaTweet::API::Model::OAuthToken RequestToken::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth){
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken;
|
||||
HttpPost::process(_oauth, [&oauthToken](const std::string& _rcv){
|
||||
auto mp = CocoaTweet::Util::parse(_rcv, '&', '=');
|
||||
if(mp.count("oauth_token")){
|
||||
oauthToken.oauthToken(mp.at("oauth_token"));
|
||||
}
|
||||
if(mp.count("oauth_token_secret")){
|
||||
oauthToken.oauthTokenSecret(mp.at("oauth_token_secret"));
|
||||
}
|
||||
std::cout << _rcv << std::endl;
|
||||
});
|
||||
return oauthToken;
|
||||
CocoaTweet::API::Model::OAuthToken RequestToken::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken;
|
||||
HttpPost::process(_oauth, [&oauthToken](const std::string& _rcv) {
|
||||
auto mp = CocoaTweet::Util::parse(_rcv, '&', '=');
|
||||
if (mp.count("oauth_token")) {
|
||||
oauthToken.oauthToken(mp.at("oauth_token"));
|
||||
}
|
||||
}
|
||||
if (mp.count("oauth_token_secret")) {
|
||||
oauthToken.oauthTokenSecret(mp.at("oauth_token_secret"));
|
||||
}
|
||||
std::cout << _rcv << std::endl;
|
||||
});
|
||||
return oauthToken;
|
||||
}
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
@@ -4,14 +4,15 @@
|
||||
#include <cocoatweet/api/interface/httpPost.h>
|
||||
#include <cocoatweet/api/model/oauthToken.h>
|
||||
|
||||
namespace CocoaTweet::API::OAuth1{
|
||||
class RequestToken: public CocoaTweet::API::Interface::HttpPost {
|
||||
public:
|
||||
RequestToken();
|
||||
void oauthCallback(const std::string& _oauthCallback);
|
||||
namespace CocoaTweet::API::OAuth1 {
|
||||
class RequestToken : public CocoaTweet::API::Interface::HttpPost {
|
||||
public:
|
||||
RequestToken();
|
||||
void oauthCallback(const std::string& _oauthCallback);
|
||||
|
||||
CocoaTweet::API::Model::OAuthToken process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
}
|
||||
CocoaTweet::API::Model::OAuthToken process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
} // namespace CocoaTweet::API::OAuth1
|
||||
|
||||
#endif
|
||||
@@ -2,15 +2,15 @@
|
||||
#include <cocoatweet/authentication/basic.h>
|
||||
|
||||
namespace CocoaTweet::API::OAuth2 {
|
||||
OAuth2::OAuth2(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth){
|
||||
oauth_ = _oauth;
|
||||
}
|
||||
OAuth2::OAuth2(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
oauth_ = _oauth;
|
||||
}
|
||||
|
||||
const std::string OAuth2::token() const{
|
||||
auto key = oauth_.lock()->key();
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::Basic>(key);
|
||||
const std::string OAuth2::token() const {
|
||||
auto key = oauth_.lock()->key();
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::Basic>(key);
|
||||
|
||||
CocoaTweet::API::OAuth2::Token token;
|
||||
return token.process(oauth);
|
||||
}
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
CocoaTweet::API::OAuth2::Token token;
|
||||
return token.process(oauth);
|
||||
}
|
||||
} // namespace CocoaTweet::API::OAuth2
|
||||
|
||||
@@ -13,14 +13,14 @@ class OAuth2 : public groupInterface {
|
||||
public:
|
||||
/// @brief primary constructor
|
||||
OAuth2() = default;
|
||||
|
||||
|
||||
/// @brief constructor which finally should to be called.
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to OAuth object
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to
|
||||
/// OAuth object
|
||||
OAuth2(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
const std::string token() const;
|
||||
|
||||
};
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
} // namespace CocoaTweet::API::OAuth2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
#include <cocoatweet/api/oauth2/token.h>
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
namespace CocoaTweet::API::OAuth2 {
|
||||
Token::Token() {
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth2/token";
|
||||
|
||||
namespace CocoaTweet::API::OAuth2{
|
||||
Token::Token(){
|
||||
contentType_ = "application/x-www-form-urlencoded";
|
||||
url_ = "https://api.twitter.com/oauth2/token";
|
||||
bodyParam_.insert_or_assign("grant_type", "client_credentials");
|
||||
}
|
||||
|
||||
bodyParam_.insert_or_assign("grant_type", "client_credentials");
|
||||
}
|
||||
|
||||
|
||||
|
||||
const std::string Token::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
const std::string Token::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
auto basic = std::make_shared<CocoaTweet::Authentication::Basic>(_oauth.lock()->key());
|
||||
std::string bearer = "";
|
||||
HttpPost::process(basic, [&bearer](const std::string& _rcv) {
|
||||
@@ -22,4 +20,4 @@ const std::string Token::process(std::weak_ptr<CocoaTweet::Authentication::Authe
|
||||
return bearer;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace CocoaTweet::API::OAuth2
|
||||
@@ -4,12 +4,13 @@
|
||||
#include <cocoatweet/api/interface/httpPost.h>
|
||||
#include <cocoatweet/authentication/basic.h>
|
||||
|
||||
namespace CocoaTweet::API::OAuth2{
|
||||
class Token: public CocoaTweet::API::Interface::HttpPost{
|
||||
public:
|
||||
Token();
|
||||
const std::string process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
}
|
||||
namespace CocoaTweet::API::OAuth2 {
|
||||
class Token : public CocoaTweet::API::Interface::HttpPost {
|
||||
public:
|
||||
Token();
|
||||
const std::string process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
} // namespace CocoaTweet::API::OAuth2
|
||||
|
||||
#endif
|
||||
@@ -18,9 +18,11 @@ public:
|
||||
void id(const std::string _id);
|
||||
|
||||
/// @brief process request for endpoint
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to oauth object
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to oauth object
|
||||
/// @param[out] CocoaTweet::API::Model::Tweet : request result
|
||||
CocoaTweet::API::Model::Tweet process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
CocoaTweet::API::Model::Tweet process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ public:
|
||||
|
||||
void id(const std::string& _id);
|
||||
|
||||
CocoaTweet::API::Model::Tweet process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
CocoaTweet::API::Model::Tweet process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ public:
|
||||
Status() = default;
|
||||
|
||||
/// @brief constructor which finally should to be called.
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to OAuth object
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to
|
||||
/// OAuth object
|
||||
Status(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
/// @brief send request to statuses/update with specified status
|
||||
|
||||
@@ -11,7 +11,8 @@ public:
|
||||
|
||||
void id(const std::string& _id);
|
||||
|
||||
CocoaTweet::API::Model::Tweet process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
CocoaTweet::API::Model::Tweet process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
};
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@ void Update::failDMCommands(bool _fail) {
|
||||
bodyParam_.insert_or_assign("fail_dmcommands", std::to_string(_fail));
|
||||
}
|
||||
|
||||
CocoaTweet::API::Model::Tweet Update::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
CocoaTweet::API::Model::Tweet Update::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
CocoaTweet::API::Model::Tweet tweet;
|
||||
HttpPost::process(_oauth, [&tweet](const std::string& _rcv) {
|
||||
tweet = CocoaTweet::API::Model::Tweet::parse(_rcv);
|
||||
|
||||
@@ -40,9 +40,11 @@ public:
|
||||
void failDMCommands(bool _fail);
|
||||
|
||||
/// @brief process request for endpoint
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to oauth object
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to oauth object
|
||||
/// @param[out] CocoaTweet::API::Model::Tweet : request result
|
||||
CocoaTweet::API::Model::Tweet process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
CocoaTweet::API::Model::Tweet process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
private:
|
||||
std::string status_;
|
||||
|
||||
@@ -19,7 +19,8 @@ public:
|
||||
void screenName(const std::string& _screenName);
|
||||
|
||||
/// @brief process request for endpoint
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to oauth object
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to oauth object
|
||||
/// @param[out] std::vector<CocoaTweet::API::Model::Tweet> : request result
|
||||
std::vector<CocoaTweet::API::Model::Tweet> process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
@@ -9,14 +9,14 @@ Show::Show() {
|
||||
}
|
||||
|
||||
void Show::screenName(const std::string& _screenName) {
|
||||
if(bodyParam_.count("user_id") > 0){
|
||||
if (bodyParam_.count("user_id") > 0) {
|
||||
bodyParam_.erase("user_id");
|
||||
}
|
||||
bodyParam_.insert_or_assign("screen_name", _screenName);
|
||||
}
|
||||
|
||||
void Show::id(const std::string& _id) {
|
||||
if(bodyParam_.count("screen_name") > 0){
|
||||
if (bodyParam_.count("screen_name") > 0) {
|
||||
bodyParam_.erase("screen_name");
|
||||
}
|
||||
bodyParam_.insert_or_assign("id", _id);
|
||||
@@ -31,4 +31,4 @@ CocoaTweet::API::Model::User Show::process(
|
||||
return user;
|
||||
}
|
||||
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
} // namespace CocoaTweet::API::Users
|
||||
|
||||
@@ -23,7 +23,8 @@ public:
|
||||
void screenName(const std::string& _screenName);
|
||||
|
||||
/// @brief process request for endpoint
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to oauth object
|
||||
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer
|
||||
/// to oauth object
|
||||
/// @param[out] CocoaTweet::API::Model::User : request result
|
||||
CocoaTweet::API::Model::User process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
@@ -31,6 +32,6 @@ public:
|
||||
private:
|
||||
std::string status_;
|
||||
};
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
} // namespace CocoaTweet::API::Users
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include <cocoatweet/api/user/user.h>
|
||||
#include <cocoatweet/api/user/show.h>
|
||||
|
||||
namespace CocoaTweet::API::Users{
|
||||
User::User(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
namespace CocoaTweet::API::Users {
|
||||
User::User(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
oauth_ = _oauth;
|
||||
}
|
||||
|
||||
CocoaTweet::API::Model::User User::show(const std::string& _screenName)const{
|
||||
CocoaTweet::API::Users::Show show;
|
||||
show.screenName(_screenName);
|
||||
return show.process(oauth_);
|
||||
}
|
||||
}
|
||||
CocoaTweet::API::Model::User User::show(const std::string& _screenName) const {
|
||||
CocoaTweet::API::Users::Show show;
|
||||
show.screenName(_screenName);
|
||||
return show.process(oauth_);
|
||||
}
|
||||
} // namespace CocoaTweet::API::Users
|
||||
@@ -13,14 +13,14 @@ class User : public groupInterface {
|
||||
public:
|
||||
/// @brief primary constructor
|
||||
User() = default;
|
||||
|
||||
|
||||
/// @brief constructor which finally should to be called.
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to OAuth object
|
||||
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to
|
||||
/// OAuth object
|
||||
User(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
|
||||
|
||||
CocoaTweet::API::Model::User show(const std::string& _screenName) const;
|
||||
|
||||
};
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
} // namespace CocoaTweet::API::Users
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user