The typepad.tpobject module houses the TypePadObject class and related classes, providing a RemoteObject based implementation of the generic TypePad API.
The module contains:
A TypePadObject representing a list of other TypePadObject instances.
Endpoints in the TypePad API can be either objects themselves or sets of objects, which are represented in the client library as ListObject instances. As the API lists are homogeneous, all ListObject instances you’ll use in practice are configured for particular TypePadObject classes (their “entry classes”). A ListObject instance will hold only instances of its configured class.
The primary way to reference a ListObject class is to call its metaclass, ListOf, with a reference to or name of that class.
>>> ListOfEntry = ListOf(Entry)
For an Entry list you then fetch with the ListOfEntry class’s get() method, all the entities in the list resource’s entries member will be decoded into Entry instances.
Returns a new ListObject instance representing the same endpoint as this ListObject instance with the additional filtering applied.
This method filters the ListObject as does RemoteObject.filter(), but specially treats filters defined in the TypePad API. These special filters are not added in as query parameters but as path components.
The index in the overall list resource of the first item in this ListObject instance.
The first item in the list has index 1.
A RemoteObject representing an object in the TypePad API.
All HTTP requests made for a TypePadObject are made through the typepad.client user agent instance. Unlike other PromiseObject instances, TypePadObject instances cannot be independently delivered; they must be delivered by an outside object (namely typepad.client).
Deletes the remote resource represented by this TypePadObject instance through an HTTP DELETE request.
Regardless of the http parameter, the request is performed with the typepad.client user agent.
Prevents self-delivery of this instance if batch requests are enabled for TypePadObject instances.
If batch requests are not enabled, delivers the object as by PromiseObject.deliver().
Promises a new TypePadObject instance for the named resource.
If parameter url is not an absolute URL, the resulting instance will reference the given URL relative to the TypePad API’s base address.
If batch requests are enabled, the request that delivers the resulting TypePadObject instance will be added to the typepad.client BatchClient instance’s batch request. If typepad.client has no active batch request, a PromiseError will be raised. The batch parameter can be used to force a non-batch request if batch requests are enabled.
Builds the API URL for this TypePadObject instance from its data.
This method returns either the fully absolute URL at which this TypePadObject instance can be found in the API, or None if the TypePadObject instance has no API URL. (A TypePadObject instance may have no URL if it has not been saved to the API, or if it is an instance of a TypePadObject subclass that is only ever used as a field in another class and so cannot be requested by itself.)
This implementation returns None. As different API objects use different URL schemes, all TypePadObject subclasses that can have self links must implement this method themselves.
Adds another TypePadObject to this remote resource through an HTTP POST request, as in HttpObject.post().
Regardless of the http parameter, the request is performed with the typepad.client user agent.
Saves a previously requested TypePadObject back to its remote resource through an HTTP PUT request, as in HttpObject.put().
Regardless of the http parameter, the request is performed with the typepad.client user agent.
Modifies this TypePadObject instance to be an instance of the specific TypePadObject subclass specified in data.
If the data specify a different TypePadObject subclass than the one of which self is an instance, self will be modified to be an instance of the described class. That is, if:
self will be turned into an instance of the class specified in the data parameter’s objectTypes list.
This method returns True if the instance was changed to be a different class, or False if it was not modified.
Updates this object with the given data, transforming it into an instance of a different TypePadObject subclass if necessary.
This implementation fills this TypePadObject instance with the data in parameter data, as in RemoteObject.update_from_dict().
If the data specify a different TypePadObject subclass than the one of which self is an instance, self will be modified to be an instance of the described class. That is, if:
self will be turned into an instance of the class specified in the data parameter’s objectTypes list.
Override the reclass_for_data() method to change when an instance is modified to be of a different subclass.
A metaclass for creating new TypePadObject classes.
In addition to the normal behavior of RemoteObject class creation, classes created by TypePadObjectMetaclass are classified by their object_type members, so their instances can be reclassified based on object_types data in API responses.