statuses/updateのエンドポイントのオプションを書いた

This commit is contained in:
keita
2021-03-11 20:33:08 +09:00
parent a8aa3173bd
commit cb2d284e54
5 changed files with 124 additions and 3 deletions
+43
View File
@@ -13,6 +13,49 @@ CocoaTweet::API::Model::Tweet Status::Update(const std::string& _status) const {
return update.process(oauth_);
}
CocoaTweet::API::Model::Tweet Status::Update(const std::string& _status, const Options _options) const{
CocoaTweet::API::Statuses::Update update;
update.status(_status);
if(_options.replyToStatusId != defaultOpt_.replyToStatusId){
update.replyToStatusId(_options.replyToStatusId);
}
if(_options.autoPopulateReplyMetaData != defaultOpt_.autoPopulateReplyMetaData){
update.autoPopulateReplyMetaData(_options.autoPopulateReplyMetaData);
}
if(_options.excludeReplyUserId != defaultOpt_.excludeReplyUserId){
update.excludeReplyUserId(_options.excludeReplyUserId);
}
if(_options.attachmentUrl != defaultOpt_.attachmentUrl){
update.attachmentUrl(_options.attachmentUrl);
}
if(_options.coord != defaultOpt_.coord){
update.coord(_options.coord);
}
if(_options.displayCoord != defaultOpt_.displayCoord){
update.displayCoord(_options.displayCoord);
}
if(_options.trimUser != defaultOpt_.trimUser){
update.trimUser(_options.trimUser);
}
if(_options.enableDMCommands != defaultOpt_.enableDMCommands){
update.enableDMCommands(_options.enableDMCommands);
}
if(_options.failDMCommands != defaultOpt_.failDMCommands){
update.failDMCommands(_options.failDMCommands);
}
return update.process(oauth_);
}
CocoaTweet::API::Model::Tweet Status::Update(const std::string& _status,
std::vector<std::string> _mediaId) const {
CocoaTweet::API::Statuses::Update update;