API class

Provides an interface for calling Ruqqus API endpoints

Constructors

API(Client client, String userAgent, {bool quietMode = false})
Creates an instance of the API interface

Properties

client Client
Instance of client for accessing accessToken
final
hashCode int
The hash code for this object.
no setterinherited
httpClient HttpClient
Allows making HTTP requests to the Ruqqus API
final
log → Sprint
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userAgent String
A string that identifies the application interacting with the API
final

Methods

delete({required SubmissionType submissionType, required String id}) Future
Delete submission
deleteAccount({required AccountDeletion accountDeletion}) Future<bool>
Deletes the account accessing the API. There is no going back!
disable2fa({required Disable2FA disable2fa}) Future<bool>
Disables 2FA on the account
edit<Submission extends Primary>({required SubmissionType parentSubmissionType, required String id, required String body}) Future<Primary?>
Edit submission by replacing previous content body with a new content body
enable2fa({required Enable2FA enable2fa}) Future<bool>
Enables 2FA on the account
get(String route, {Map<String, dynamic> headers = const {}}) Future<Response?>
Submits a HTTP GET request with the given headers
logoutAll({required String password}) Future<bool>
Logs all other instances out
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(String route, {Map<String, dynamic> headers = const {}, Map<String, dynamic> body = const {}}) Future<Response?>
Submits a HTTP POST request with the given headers and body
submitPost({required String targetGuild, required String title, required String body, String? url}) Future<Post?>
Submits a Post to a Guild with the specified title and body, and an optional url hyperlink
submitReply({required SubmissionType parentSubmissionType, required String id, required String body}) Future<Comment?>
Submits a Comment as a reply to the given submission with the specified body
toString() String
A string representation of this object.
inherited
updateEmail({required UpdateEmail updateEmail}) Future<bool>
Updates the account's email
updatePassword({required UpdatePassword updatePassword}) Future<bool>
Updates the account's password
updateProfileSettings({required ProfileSettings profileSettings}) Future<bool>
Updates the account's profile settings

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

apiVersion → const String
grantUrl → const String
host → const String