mastodon-cpp  0.110.0
instance.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_INSTANCE_HPP
18 #define MASTODON_CPP_EASY_INSTANCE_HPP
19 
20 #include <string>
21 #include <vector>
22 
23 using std::uint64_t;
24 
25 #include "../../mastodon-cpp.hpp"
26 #include "../entity.hpp"
27 #include "account.hpp"
28 
29 using std::string;
30 
31 namespace Mastodon
32 {
33 namespace Easy
34 {
40  class Instance : public Entity
41  {
42  public:
43  using Entity::Entity;
44 
45  virtual bool valid() const override;
46 
52  const Account contact_account() const;
53 
59  const string description() const;
60 
67  const string email() const;
68 
75  const vector<string> languages() const;
76 
82  const string thumbnail() const;
83 
89  const string title() const;
90 
96  const string uri() const;
97 
103  const Easy::urls_type urls() const;
104 
110  const Easy::stats_type stats() const;
111 
117  const string version() const;
118 
127  uint64_t max_toot_chars() const;
128  };
129 }
130 }
131 
132 #endif // MASTODON_CPP_EASY_INSTANCE_HPP
Entity()
Constructs an empty Entity object.
Definition: entity.cpp:43
const Easy::urls_type urls() const
Returns the URL for the streaming API and possibly others.
Definition: instance.cpp:85
Class to hold instances.
Definition: instance.hpp:40
const vector< string > languages() const
Returns a vector of ISO 6391 language codes the instance has chosen to advertise.
Definition: instance.cpp:61
const string uri() const
Returns the URI of the instance.
Definition: instance.cpp:80
Statistics returned by Instance::stats().
Definition: types_easy.hpp:222
const string email() const
Returns the email address which can be used to contact the instance administrator.
Definition: instance.cpp:56
const Easy::stats_type stats() const
Returns statistics about the instance.
Definition: instance.cpp:66
const string title() const
Returns the title of the instance.
Definition: instance.cpp:75
const Account contact_account() const
Returns the Account of the admin or another contact person.
Definition: instance.cpp:40
const string thumbnail() const
Returns the thumbnail of the instance.
Definition: instance.cpp:95
Class to hold accounts.
Definition: account.hpp:42
uint64_t max_toot_chars() const
Returns the maximum chars a post can have.
Definition: instance.cpp:100
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
URLs returned by Instance::urls().
Definition: types_easy.hpp:214
virtual bool valid() const override
Returns true if the Entity holds valid data.
Definition: instance.cpp:25
const string description() const
Returns the description of the instance.
Definition: instance.cpp:51
const string version() const
Returns the version used by the instance.
Definition: instance.cpp:90