mastodon-cpp  0.110.0
token.hpp
1 /* This file is part of mastodon-cpp.
2  * Copyright © 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_TOKEN_HPP
18 #define MASTODON_CPP_EASY_TOKEN_HPP
19 
20 #include <string>
21 
22 #include "../../mastodon-cpp.hpp"
23 #include "../entity.hpp"
24 
25 using std::string;
26 
27 namespace Mastodon
28 {
29 namespace Easy
30 {
36  class Token : public Entity
37  {
38  public:
39  using Entity::Entity;
40 
41  virtual bool valid() const override;
42 
48  const string access_token() const;
49 
55  const string token_type() const;
56 
62  const string scope() const;
63 
69  const Easy::time_type created_at() const;
70 };
71 }
72 }
73 
74 #endif // MASTODON_CPP_EASY_TOKEN_HPP
const string access_token() const
Returns the access token.
Definition: token.cpp:33
Entity()
Constructs an empty Entity object.
Definition: entity.cpp:43
const Easy::time_type created_at() const
Returns the date of creation.
Definition: token.cpp:48
const string scope() const
Returns the scope of the token.
Definition: token.cpp:43
const string token_type() const
Returns the token type.
Definition: token.cpp:38
Class to hold applications.
Definition: token.hpp:36
Type for time. Converts to time_point and string.
Definition: types_easy.hpp:150
virtual bool valid() const override
Returns true if the Entity holds valid data.
Definition: token.cpp:22
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