dm用のエントリーポイント

This commit is contained in:
keita
2021-04-01 21:51:45 +09:00
parent b9d40e25c3
commit 1482347c48
2 changed files with 41 additions and 0 deletions
@@ -0,0 +1,15 @@
#include <cocoatweet/api/directMessage/directMessage.h>
#include <cocoatweet/api/directMessage/new.h>
namespace CocoaTweet::API::DirectMessages{
DirectMessage::DirectMessage(std::shared_ptr<CocoaTweet::OAuth::OAuth1> _oauth){
oauth_ = _oauth;
}
void DirectMessage::messageCreate(const std::string& _recipient, const std::string& _message){
CocoaTweet::API::DirectMessages::New dm;
dm.recipient(_recipient);
dm.message(_message);
dm.process(oauth_);
}
}
@@ -0,0 +1,26 @@
#ifndef COCOATWEET_API_DIRECTMESSAGE_DIRECTMESSAGE_H_
#define COCOATWEET_API_DIRECTMESSAGE_DIRECTMESSAGE_H_
#include "cocoatweet/api/interface/groupInterface.h"
#include "cocoatweet/oauth/oauth.h"
#include <cocoatweet/api/model/tweet.h>
#include <vector>
#include <utility>
namespace CocoaTweet::API::DirectMessages {
/// @brief Entory point for statuses/*
class DirectMessage : public groupInterface {
public:
DirectMessage() = default;
/// @brief constructor which finally should to be called.
/// @param[in] std::shared_ptr<CocoaTweet::OAuth::OAuth1> : pointer to OAuth object
DirectMessage(std::shared_ptr<CocoaTweet::OAuth::OAuth1> _oauth);
void messageCreate(const std::string& _recipient, const std::string& _message);
private:
};
} // namespace CocoaTweet::API::Statuses
#endif