mastodon-cpp  0.110.0
account.hpp
1 /* This file is part of mastodon-cpp.
2  * Copyright © 2018, 2019 tastytea <tastytea@tastytea.de>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as published by
6  * the Free Software Foundation, version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef MASTODON_CPP_EASY_ACCOUNT_HPP
18 #define MASTODON_CPP_EASY_ACCOUNT_HPP
19 
20 #include <string>
21 #include <cstdint>
22 #include <vector>
23 #include <utility>
24 
25 #include "../../mastodon-cpp.hpp"
26 #include "../entity.hpp"
27 #include "emoji.hpp"
28 
29 using std::string;
30 using std::uint64_t;
31 using std::vector;
32 
33 namespace Mastodon
34 {
35 namespace Easy
36 {
42  class Account : public Entity
43  {
44  public:
45  using Entity::Entity;
46 
47  virtual bool valid() const override;
48 
57  const string acct() const;
58 
64  const string avatar() const;
65 
71  const string avatar_static() const;
72 
78  bool bot() const;
79 
85  const Easy::time_type created_at() const;
86 
92  const string display_name() const;
93 
99  const std::vector<Easy::Emoji> emojis();
100 
106  const vector<Easy::account_field_type> fields() const;
107 
113  uint64_t followers_count() const;
114 
120  uint64_t following_count() const;
121 
127  const string header() const;
128 
134  const string header_static() const;
135 
141  const string id() const;
142 
148  bool locked() const;
149 
155  bool has_moved() const;
156 
163  const Account moved() const;
164 
170  const string note() const;
171 
177  visibility_type privacy() const;
178 
184  bool sensitive() const;
185 
191  class Source : public Entity
192  {
193  public:
194  using Entity::Entity;
195 
196  virtual bool valid() const override;
197 
203  const vector<Easy::account_field_type> fields() const;
204 
210  const string language() const;
211 
217  const string note() const;
218 
224  visibility_type privacy() const;
225 
231  bool sensitive() const;
232  };
233 
239  const Source source() const;
240 
246  uint64_t statuses_count() const;
247 
253  const string url() const;
254 
260  const string username() const;
261 };
262 }
263 }
264 
265 #endif // MASTODON_CPP_EASY_ACCOUNT_HPP
const string avatar() const
Returns URL of avatar.
Definition: account.cpp:53
const Source source() const
Get source.
Definition: account.cpp:195
const string header() const
Returns URL of header image.
Definition: account.cpp:130
bool sensitive() const
Returns if media is marked as sensitive by default.
Definition: account.cpp:190
const string avatar_static() const
Returns URL of static avatar.
Definition: account.cpp:58
Entity()
Constructs an empty Entity object.
Definition: entity.cpp:43
const string acct() const
Returns username.
Definition: account.cpp:48
uint64_t following_count() const
Returns number of people this account follows.
Definition: account.cpp:125
virtual bool valid() const override
Returns true if the Entity holds valid data.
Definition: account.cpp:215
uint64_t statuses_count() const
Returns number of statuses.
Definition: account.cpp:200
bool bot() const
Returns true if the account performs automated actions.
Definition: account.cpp:63
const string note() const
Returns account description, or biography.
Definition: account.cpp:170
const string note() const
Returns account description in plain text.
Definition: account.cpp:253
Type for time. Converts to time_point and string.
Definition: types_easy.hpp:150
uint64_t followers_count() const
Returns number of followers.
Definition: account.cpp:120
const string header_static() const
Returns URL of static header image.
Definition: account.cpp:135
visibility_type privacy() const
Returns default privacy of new toots.
Definition: account.cpp:175
const vector< Easy::account_field_type > fields() const
Returns metadata fields.
Definition: account.cpp:96
const Easy::time_type created_at() const
Returns time of creation.
Definition: account.cpp:68
virtual bool valid() const override
Returns true if the Entity holds valid data.
Definition: account.cpp:25
const string username() const
Returns username (without @hostname)
Definition: account.cpp:210
const std::vector< Easy::Emoji > emojis()
Returns emojis.
Definition: account.cpp:78
const string display_name() const
Returns display name.
Definition: account.cpp:73
Class to hold accounts.
Definition: account.hpp:42
const Account moved() const
If the owner decided to switch accounts, new account is in this attribute.
Definition: account.cpp:160
Collection of things to interface with server software that implements the Mastodon API.
Definition: mastodon-cpp.hpp:47
Base class for all entities.
Definition: entity.hpp:36
visibility_type privacy() const
Returns default privacy of new toots.
Definition: account.cpp:258
bool locked() const
Returns true if the account is locked.
Definition: account.cpp:145
const string id() const
Returns account-ID.
Definition: account.cpp:140
Class to hold source attribute.
Definition: account.hpp:191
bool sensitive() const
Returns if media is marked as sensitive by default.
Definition: account.cpp:273
visibility_type
Describes visibility of posts.
Definition: types_easy.hpp:54
const string language() const
Returns the language as ISO 6391 string.
Definition: account.cpp:248
const string url() const
Returns URL of the profile.
Definition: account.cpp:205
bool has_moved() const
Returns true if the account has been moved. (Deprecated)
Definition: account.cpp:150
const vector< Easy::account_field_type > fields() const
Returns metadata fields.
Definition: account.cpp:224