mastodonpp  0.0.0
Public Types | Public Member Functions | List of all members
mastodonpp::API Class Reference

Holds API endpoints. More...

#include <mastodonpp/api.hpp>

Public Types

enum  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
}
 An enumeration of all v1 API endpoints. More...
 
enum  v2 { search }
 An enumeration of all v2 API endpoints. More...
 
enum  oauth { authorize, token, revoke }
 An enumeration of all oauth API endpoints. More...
 
enum  other { proofs, oembed }
 An enumeration of all other API endpoints. More...
 
enum  pleroma {
  admin_users, admin_users_follow, admin_users_unfollow, admin_users_nickname,
  admin_users_tag, admin_users_nickname_permission_group, admin_users_nickname_permission_group_permission_group, admin_users_nickname_activation_status,
  admin_users_nickname_or_id, admin_users_nickname_or_id_statuses, admin_relay, admin_users_invite_token,
  admin_users_invites, admin_users_revoke_invite, admin_users_email_invite, admin_users_nickname_password_reset,
  admin_reports, admin_reports_id, admin_reports_id_respond, admin_statuses_id,
  admin_config_migrate_to_db, admin_config_migrate_from_db, admin_config, emoji,
  follow_import, captcha, delete_account, disable_account,
  account_register, pleroma_notification_settings, pleroma_healthcheck, pleroma_change_email
}
 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 1.1.7.

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 _.

Since
0.1.0
222  {
223  authorize,
224  token,
225  revoke
226  };

◆ other

An enumeration of all other API endpoints.

These endpoints are directly under /api/.

The original / are substituted with _.

Since
0.1.0
238  {
239  proofs,
240  oembed
241  };

◆ pleroma

An enumeration of all pleroma API endpoints.

The original / are substituted with _.

Since
0.1.0
251  {
252  admin_users,
253  admin_users_follow,
254  admin_users_unfollow,
255  admin_users_nickname,
256  admin_users_tag,
257  admin_users_nickname_permission_group,
258  admin_users_nickname_permission_group_permission_group,
259  admin_users_nickname_activation_status,
260  admin_users_nickname_or_id,
261  admin_users_nickname_or_id_statuses,
262  admin_relay,
263  admin_users_invite_token,
264  admin_users_invites,
265  admin_users_revoke_invite,
266  admin_users_email_invite,
267  admin_users_nickname_password_reset,
268  admin_reports,
269  admin_reports_id,
270  admin_reports_id_respond,
271  admin_statuses_id,
272  admin_config_migrate_to_db,
273  admin_config_migrate_from_db,
274  admin_config,
275 
276  emoji,
277  follow_import,
278  captcha,
279 
280  delete_account,
281  disable_account,
282  account_register,
283 
284  pleroma_notification_settings,
285  pleroma_healthcheck,
286  pleroma_change_email
287  };

◆ v1

enum mastodonpp::API::v1
strong

An enumeration of all v1 API endpoints.

The original / are substituted with _.

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 
188  pleroma_accounts_id_subscribe,
189  pleroma_accounts_id_unsubscribe,
190  pleroma_accounts_id_favourites,
191  pleroma_accounts_update_avatar,
192  pleroma_accounts_update_banner,
193  pleroma_accounts_update_background,
194  pleroma_accounts_confirmation_resend,
195 
196  pleroma_mascot,
197 
198  pleroma_conversations_id_statuses,
199  pleroma_conversations_id,
200  };

◆ v2

enum mastodonpp::API::v2
strong

An enumeration of all v2 API endpoints.

The original / are substituted with _.

Since
0.1.0
210  {
211  search
212  };

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
314  {
315  return _endpoint_map.at(_endpoint);
316  }

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