mastodonpp  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
Public Types | Public Member Functions | List of all members
mastodonpp::API Class Reference

Holds API endpoints. More...

#include <mastodonpp/api.hpp>

Public Types

enum class  v1 {
  apps , apps_verify_credentials , accounts , accounts_verify_credentials ,
  accounts_update_credentials , accounts_id , accounts_id_statuses , accounts_id_followers ,
  accounts_id_following , accounts_id_lists , accounts_id_identity_proofs , accounts_id_follow ,
  accounts_id_unfollow , accounts_id_block , accounts_id_unblock , accounts_id_mute ,
  accounts_id_unmute , accounts_id_pin , accounts_id_unpin , accounts_relationships ,
  accounts_search , bookmarks , favourites , mutes ,
  blocks , domain_blocks , filters , filters_id ,
  reports , follow_requests , follow_requests_id_authorize , follow_requests_id_reject ,
  endorsements , featured_tags , featured_tags_id , featured_tags_suggestions ,
  preferences , suggestions , suggestions_account_id , statuses ,
  statuses_id , statuses_id_context , statuses_id_reblogged_by , statuses_id_favourited_by ,
  statuses_id_favourite , statuses_id_unfavourite , statuses_id_reblog , statuses_id_unreblog ,
  statuses_id_bookmark , statuses_id_unbookmark , statuses_id_mute , statuses_id_unmute ,
  statuses_id_pin , statuses_id_unpin , media , media_id ,
  polls_id , polls_id_votes , scheduled_statuses , scheduled_statuses_id ,
  timelines_public , timelines_tag_hashtag , timelines_home , timelines_list_list_id ,
  conversations , conversations_id , conversations_id_read , lists ,
  lists_id , lists_id_accounts , markers , streaming_health ,
  streaming_user , streaming_public , streaming_public_local , streaming_hashtag ,
  streaming_hashtag_local , streaming_list , streaming_direct , notifications ,
  notifications_id , notifications_clear , notifications_id_dismiss , push_subscription ,
  instance , instance_peers , instance_activity , trends ,
  directory , custom_emojis , admin_accounts , admin_accounts_id ,
  admin_accounts_account_id_action , admin_accounts_id_approve , admin_accounts_id_reject , admin_accounts_id_enable ,
  admin_accounts_id_unsilence , admin_accounts_id_unsuspend , admin_reports , admin_reports_id ,
  admin_reports_id_assign_to_self , admin_reports_id_unassign , admin_reports_id_resolve , admin_reports_id_reopen ,
  pleroma_notifications_read , pleroma_accounts_id_subscribe , pleroma_accounts_id_unsubscribe , pleroma_accounts_id_favourites ,
  pleroma_accounts_update_avatar , pleroma_accounts_update_banner , pleroma_accounts_update_background , pleroma_accounts_confirmation_resend ,
  pleroma_mascot , pleroma_conversations_id_statuses , pleroma_conversations_id , pleroma_conversations_id_read ,
  pleroma_accounts_id_scrobbles , pleroma_scrobble , pleroma_statuses_id_reactions_emoji , pleroma_statuses_id_reactions
}
 An enumeration of all v1 API endpoints. More...
 
enum class  v2 { search }
 An enumeration of all v2 API endpoints. More...
 
enum class  oauth { authorize , token , revoke }
 An enumeration of all oauth API endpoints. More...
 
enum class  other { proofs , oembed }
 An enumeration of all other API endpoints. More...
 
enum class  pleroma {
  admin_users , admin_users_follow , admin_users_unfollow , admin_users_nickname_toggle_activation ,
  admin_users_tag , admin_users_nickname_permission_group , admin_users_nickname_permission_group_permission_group , admin_users_permission_group_permission_group ,
  admin_users_activate , admin_users_deactivate , admin_users_nickname_or_id , admin_users_nickname_or_id_statuses ,
  admin_instances_instance_statuses , admin_statuses , admin_relay , admin_users_invite_token ,
  admin_users_invites , admin_users_revoke_invite , admin_users_email_invite , admin_users_nickname_password_reset ,
  admin_users_nickname_update_credentials , admin_users_force_password_reset , admin_reports , admin_grouped_reports ,
  admin_reports_id , admin_reports_id_notes , admin_reports_report_id_notes_id , admin_statuses_id ,
  admin_restart , admin_config , admin_config_descriptions , admin_moderation_log ,
  admin_reload_emoji , admin_users_confirm_email , admin_users_resend_confirm_email , admin_stats ,
  admin_users_nickname , admin_users_nickname_activation_status , admin_reports_id_respond , admin_config_migrate_to_db ,
  admin_config_migrate_from_db , emoji , follow_import , captcha ,
  delete_account , disable_account , notification_settings , healthcheck ,
  change_email , emoji_packs , emoji_packs_name , emoji_packs_name_update_file ,
  emoji_packs_name_update_metadata , emoji_packs_download_from , emoji_packs_list_from , emoji_packs_name_download_shared ,
  account_register
}
 An enumeration of all pleroma API endpoints. More...
 
using endpoint_type = variant< v1, v2, oauth, other, pleroma >
 Type for endpoints. Can be API::v1, API::v2, API::oauth, API::other or API::pleroma. More...
 

Public Member Functions

 API (const endpoint_type &endpoint)
 Constructs an API object. You should never need this. More...
 
string_view to_string_view () const
 Convert endpoint_type to std::string_view. More...
 

Detailed Description

Holds API endpoints.

Supported API endpoints: Mastodon 3.0.1, Pleroma 2.0.2.

Since
0.1.0

Member Typedef Documentation

◆ endpoint_type

Type for endpoints. Can be API::v1, API::v2, API::oauth, API::other or API::pleroma.

Since
0.1.0

Member Enumeration Documentation

◆ oauth

An enumeration of all oauth API endpoints.

The original / are substituted with _. : are omitted.

Since
0.1.0
224  {
225  authorize,
226  token,
227  revoke
228  };

◆ other

An enumeration of all other API endpoints.

These endpoints are directly under /api/.

The original / are substituted with _. : are omitted.

Since
0.1.0
240  {
241  proofs,
242  oembed
243  };

◆ pleroma

An enumeration of all pleroma API endpoints.

The original / are substituted with _. : are omitted.

Since
0.1.0
253  {
254  admin_users,
255  admin_users_follow,
256  admin_users_unfollow,
257  admin_users_nickname_toggle_activation,
258  admin_users_tag,
259  admin_users_nickname_permission_group,
260  admin_users_nickname_permission_group_permission_group,
261  admin_users_permission_group_permission_group,
262  admin_users_activate,
263  admin_users_deactivate,
264  admin_users_nickname_or_id,
265  admin_users_nickname_or_id_statuses,
266  admin_instances_instance_statuses,
267  admin_statuses,
268  admin_relay,
269  admin_users_invite_token,
270  admin_users_invites,
271  admin_users_revoke_invite,
272  admin_users_email_invite,
273  admin_users_nickname_password_reset,
274  admin_users_nickname_update_credentials,
275  admin_users_force_password_reset,
276  admin_reports,
277  admin_grouped_reports,
278  admin_reports_id,
279  admin_reports_id_notes,
280  admin_reports_report_id_notes_id,
281  admin_statuses_id,
282  admin_restart,
283  admin_config,
284  admin_config_descriptions,
285  admin_moderation_log,
286  admin_reload_emoji,
287  admin_users_confirm_email,
288  admin_users_resend_confirm_email,
289  admin_stats,
290 
291  // No longer documented for Pleroma 2.0.0.
292  admin_users_nickname,
293  admin_users_nickname_activation_status,
294  admin_reports_id_respond,
295  admin_config_migrate_to_db,
296  admin_config_migrate_from_db,
297 
298  emoji,
299  follow_import,
300  captcha,
301  delete_account,
302  disable_account,
303  notification_settings,
304  healthcheck,
305  change_email,
306  emoji_packs,
307  emoji_packs_name,
308  emoji_packs_name_update_file,
309  emoji_packs_name_update_metadata,
310  emoji_packs_download_from,
311  emoji_packs_list_from,
312  emoji_packs_name_download_shared,
313 
314  // No longer documented for Pleroma 2.0.0.
315  account_register,
316 
317  };

◆ v1

enum mastodonpp::API::v1
strong

An enumeration of all v1 API endpoints.

The original / are substituted with _. : are omitted.

Since
0.1.0
51  {
52  apps,
53  apps_verify_credentials,
54 
55  accounts,
56  accounts_verify_credentials,
57  accounts_update_credentials,
58  accounts_id,
59  accounts_id_statuses,
60  accounts_id_followers,
61  accounts_id_following,
62  accounts_id_lists,
63  accounts_id_identity_proofs,
64  accounts_id_follow,
65  accounts_id_unfollow,
66  accounts_id_block,
67  accounts_id_unblock,
68  accounts_id_mute,
69  accounts_id_unmute,
70  accounts_id_pin,
71  accounts_id_unpin,
72  accounts_relationships,
73  accounts_search,
74 
75  bookmarks,
76 
77  favourites,
78 
79  mutes,
80 
81  blocks,
82 
83  domain_blocks,
84 
85  filters,
86  filters_id,
87 
88  reports,
89 
90  follow_requests,
91  follow_requests_id_authorize,
92  follow_requests_id_reject,
93 
94  endorsements,
95 
96  featured_tags,
97  featured_tags_id,
98  featured_tags_suggestions,
99 
100  preferences,
101 
102  suggestions,
103  suggestions_account_id,
104 
105  statuses,
106  statuses_id,
107  statuses_id_context,
108  statuses_id_reblogged_by,
109  statuses_id_favourited_by,
110  statuses_id_favourite,
111  statuses_id_unfavourite,
112  statuses_id_reblog,
113  statuses_id_unreblog,
114  statuses_id_bookmark,
115  statuses_id_unbookmark,
116  statuses_id_mute,
117  statuses_id_unmute,
118  statuses_id_pin,
119  statuses_id_unpin,
120 
121  media,
122  media_id,
123 
124  polls_id,
125  polls_id_votes,
126 
127  scheduled_statuses,
128  scheduled_statuses_id,
129 
130  timelines_public,
131  timelines_tag_hashtag,
132  timelines_home,
133  timelines_list_list_id,
134 
135  conversations,
136  conversations_id,
137  conversations_id_read,
138 
139  lists,
140  lists_id,
141  lists_id_accounts,
142 
143  markers,
144 
145  streaming_health,
146  streaming_user,
147  streaming_public,
148  streaming_public_local,
149  streaming_hashtag,
150  streaming_hashtag_local,
151  streaming_list,
152  streaming_direct,
153 
154  notifications,
155  notifications_id,
156  notifications_clear,
157  notifications_id_dismiss,
158 
159  push_subscription,
160 
161  instance,
162  instance_peers,
163  instance_activity,
164 
165  trends,
166 
167  directory,
168 
169  custom_emojis,
170 
171  admin_accounts,
172  admin_accounts_id,
173  admin_accounts_account_id_action,
174  admin_accounts_id_approve,
175  admin_accounts_id_reject,
176  admin_accounts_id_enable,
177  admin_accounts_id_unsilence,
178  admin_accounts_id_unsuspend,
179  admin_reports,
180  admin_reports_id,
181  admin_reports_id_assign_to_self,
182  admin_reports_id_unassign,
183  admin_reports_id_resolve,
184  admin_reports_id_reopen,
185 
186  pleroma_notifications_read,
187  pleroma_accounts_id_subscribe,
188  pleroma_accounts_id_unsubscribe,
189  pleroma_accounts_id_favourites,
190  pleroma_accounts_update_avatar,
191  pleroma_accounts_update_banner,
192  pleroma_accounts_update_background,
193  pleroma_accounts_confirmation_resend,
194  pleroma_mascot,
195  pleroma_conversations_id_statuses,
196  pleroma_conversations_id,
197  pleroma_conversations_id_read,
198  pleroma_accounts_id_scrobbles,
199  pleroma_scrobble,
200  pleroma_statuses_id_reactions_emoji,
201  pleroma_statuses_id_reactions,
202  };

◆ v2

enum mastodonpp::API::v2
strong

An enumeration of all v2 API endpoints.

The original / are substituted with _. : are omitted.

Since
0.1.0
212  {
213  search
214  };

Constructor & Destructor Documentation

◆ API()

mastodonpp::API::API ( const endpoint_type endpoint)
explicit

Constructs an API object. You should never need this.

This constructor exists to hide away the class members, which are used internally.

Since
0.1.0
23  : _endpoint{endpoint}
24 {}

Member Function Documentation

◆ to_string_view()

string_view mastodonpp::API::to_string_view ( ) const
inline

Convert endpoint_type to std::string_view.

Since
0.1.0
343  {
344  return _endpoint_map.at(_endpoint);
345  }

The documentation for this class was generated from the following files: