Home | Trees | Indices | Help |
---|
|
object --+ | BaseApiObject
The BaseApiObject helps with (de)serialization from/to JSON.
The derived class has two ways of defining custom attributes:
It's recommended that the _get_attributes() implementation do caching to avoid computing the dictionary on every invocation.
The derived class's constructor must call the base class's init() static method. All constructor arguments (aside from self and resource_root) must be keywords arguments with default values (typically None), or from_json_dict() will not work.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|||
|
|
|||
|
|
|||
_ATTRIBUTES =
|
|||
_WHITELIST =
|
|
|||
Inherited from |
|
Returns a map of property names to attr instances (or None for default attribute behavior) describing the properties of the object. By default, this method will return the class's _ATTRIBUTES field. Classes can override this method to do custom initialization of the attributes when needed. |
Wraper around the real constructor to avoid issues with the 'self' argument. Call like this, from a subclass's constructor:
|
Initializes internal state and sets all known writable properties of the object to None. Then initializes the properties given in the provided attributes dictionary.
|
Sets all the attributes in the dictionary. Optionally, allows setting read-only attributes (e.g. when deserializing from JSON) and skipping JSON deserialization of values. |
x.__setattr__('name', value) <==> x.name = value
|
Default implementation of __str__. Uses the type name and the first attribute retrieved from the attribute map to create the string.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Jan 31 10:52:18 2017 | http://epydoc.sourceforge.net |