Manager<T extends WritableSnowflakeEntity<T> > class
abstract
Provides the means to interact with the API for a given entity type.
Managers provide methods for creating objects (create), caching them (cache and get), fetching them from the API (fetch), updating them (update) and deleting them (delete).
parse can be used to convert a raw API response into an instance of the managed type.
- Inheritance
-
- Object
- ReadOnlyManager<
T> - Manager
- Implementers
Constructors
-
Manager(CacheConfig<
T> config, NyxxRest client, {required String identifier}) - Create a new manager.
Properties
Methods
-
create(
covariant CreateBuilder< T> builder) → Future<T> - Create a new instance of the type of this manager.
-
delete(
Snowflake id) → Future< void> -
Delete the item with the given
id
from the API. -
fetch(
Snowflake id) → Future< T> -
Fetch the item with the given
id
from the API.inherited -
get(
Snowflake id) → Future< T> -
Get an item by its
id
from the cache if it exists, else fetch it from the API.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
Map< String, Object?> raw) → T -
Parse the
raw
data received from the API into an instance of the type of this manager.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
update(
Snowflake id, covariant UpdateBuilder< T> builder) → Future<T> -
Update the item with the given
id
in the API.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Snowflake id) → WritableSnowflakeEntity< T> -
Return a partial instance of the entity with ID
id
containing no data.override