Abstract
Base class for every model returned by the API.
Holds a back-reference to the Client that produced the model so that convenience methods (for example downloading a track) can issue further requests without the caller threading the client around manually.
Optional
The owning client, stored for later convenience calls.
The client that created this model, used by convenience methods.
Protected
Assert that this model carries a client, returning it narrowed to non-null.
Convenience methods that need to call the API use this to fail fast with a clear message instead of a generic "cannot read property of undefined".
The owning Client.
When the model was created without a client.
Base class for every model returned by the API.
Holds a back-reference to the Client that produced the model so that convenience methods (for example downloading a track) can issue further requests without the caller threading the client around manually.