tweet.h
Go to the documentation of this file.
#ifndef COCOATWEET_API_MODEL_TWEET_H_
#define COCOATWEET_API_MODEL_TWEET_H_
#include <cocoatweet/api/model/user.h>
#include <string>
namespace CocoaTweet::API::Model {
class Tweet final {
public:
Tweet() = default;
Tweet(const Tweet&) = default;
Tweet(const std::string& _json) : Tweet(Tweet::parse(_json)) {}
static Tweet parse(const std::string& _json);
void id(const std::string _id);
void createdAt(const std::string _at);
void text(const std::string _text);
void source(const std::string _source);
void user(const CocoaTweet::API::Model::User _user);
const std::string id() const;
const std::string createdAt() const;
const std::string text() const;
const std::string source() const;
const CocoaTweet::API::Model::User user() const;
private:
std::string id_;
std::string createdAt_;
std::string text_;
std::string source_;
CocoaTweet::API::Model::User user_;
};
} // namespace CocoaTweet::API::Model
#endif
CocoaTweet::API::Model::Tweet
data class for tweet object
Definition: tweet.h:10
CocoaTweet::API::Model::Tweet::text
const std::string text() const
get tweet text
Definition: tweet.cc:48
CocoaTweet::API::Model::Tweet::parse
static Tweet parse(const std::string &_json)
response parser for tweet object
Definition: tweet.cc:5
CocoaTweet::API::Model::Tweet::Tweet
Tweet(const std::string &_json)
constructor for create object from json response
Definition: tweet.h:20
CocoaTweet::API::Model::Tweet::Tweet
Tweet()=default
constructor
CocoaTweet::API::Model::Tweet::createdAt
const std::string createdAt() const
get tweet create time
Definition: tweet.cc:44
CocoaTweet::API::Model::Tweet::source
const std::string source() const
get tweet source information
Definition: tweet.cc:52
CocoaTweet::API::Model
Definition: mediaStore.cc:5
user.h
CocoaTweet::API::Model::Tweet::user
const CocoaTweet::API::Model::User user() const
Definition: tweet.cc:56
CocoaTweet::API::Model::Tweet::id
const std::string id() const
get tweet id
Definition: tweet.cc:40
CocoaTweet::API::Model::User
data class for tweet object
Definition: user.h:9