diff --git a/src/cocoatweet/api/status/retweet.cc b/src/cocoatweet/api/status/retweet.cc new file mode 100644 index 0000000..0f7877d --- /dev/null +++ b/src/cocoatweet/api/status/retweet.cc @@ -0,0 +1,21 @@ +#include +#include + +namespace CocoaTweet::API::Statuses { + Retweet::Retweet(){} + + void Retweet::id(const std::string& _id){ + contentType_ = "application/x-www-form-urlencoded"; + url_ = "https://api.twitter.com/1.1/statuses/retweet/" + _id + ".json"; + } + + CocoaTweet::API::Model::Tweet Retweet::process(std::weak_ptr _oauth){ + CocoaTweet::API::Model::Tweet tweet; + HttpPost::process(_oauth, + [&tweet](const unsigned int _responseCode, const std::string& _rcv) { + tweet = CocoaTweet::API::Model::Tweet(_responseCode, _rcv); + }); + + return tweet; + } +} diff --git a/src/cocoatweet/api/status/retweet.h b/src/cocoatweet/api/status/retweet.h new file mode 100644 index 0000000..500f5e4 --- /dev/null +++ b/src/cocoatweet/api/status/retweet.h @@ -0,0 +1,18 @@ +#ifndef COCOATWEET_API_STATUS_RETWEET_H_ +#define COCOATWEET_API_STATUS_RETWEET_H_ + +#include +#include + +namespace CocoaTweet::API::Statuses { + class Retweet : public CocoaTweet::API::Interface::HttpPost{ + public: + Retweet(); + + void id(const std::string& _id); + + CocoaTweet::API::Model::Tweet process(std::weak_ptr _oauth); + }; +} + +#endif \ No newline at end of file