diff --git a/src/cocoatweet/api/status/unretweet.cc b/src/cocoatweet/api/status/unretweet.cc new file mode 100644 index 0000000..92378da --- /dev/null +++ b/src/cocoatweet/api/status/unretweet.cc @@ -0,0 +1,21 @@ +#include +#include + +namespace CocoaTweet::API::Statuses { +Unretweet::Unretweet() {} + +void Unretweet::id(const std::string& _id) { + contentType_ = "application/x-www-form-urlencoded"; + url_ = "https://api.twitter.com/1.1/statuses/unretweet/" + _id + ".json"; +} + +CocoaTweet::API::Model::Tweet Unretweet::process( + std::weak_ptr _oauth) { + CocoaTweet::API::Model::Tweet tweet; + HttpPost::process(_oauth, [&tweet](const std::string& _rcv) { + tweet = CocoaTweet::API::Model::Tweet(_rcv); + }); + + return tweet; +} +} // namespace CocoaTweet::API::Statuses diff --git a/src/cocoatweet/api/status/unretweet.h b/src/cocoatweet/api/status/unretweet.h new file mode 100644 index 0000000..4f2421f --- /dev/null +++ b/src/cocoatweet/api/status/unretweet.h @@ -0,0 +1,18 @@ +#ifndef COCOATWEET_API_STATUS_UNRETWEET_H_ +#define COCOATWEET_API_STATUS_UNRETWEET_H_ + +#include +#include + +namespace CocoaTweet::API::Statuses { +class Unretweet : public CocoaTweet::API::Interface::HttpPost { +public: + Unretweet(); + + void id(const std::string& _id); + + CocoaTweet::API::Model::Tweet process(std::weak_ptr _oauth); +}; +} // namespace CocoaTweet::API::Statuses + +#endif