BaseSpaceR (version 1.16.0)

Response-class: Item, Collection and Response objects


These virtual classes provide the building blocks for the containers return by quering various BaseSpace resource. They are modeled after the Response container defined by the REST API.

Conceptually there are two response types exposed by BaseSpace, an individual response and a collection response. The former, modeled by the Item S4 class, is used when querying an individual item/instance within a resource. The later is used for listing the items/instances available for a given resource and is modeled by the Collection S4 class.


Item Accessors

The Item class models a simple unordered set of key/value pairs. There is a core set of keys, for which access methods are defined and which are inherited by any child class. In the following x is an Item object.
The $ operator can be used to access the Item elements. When x is an Item object this is equivalet to @. But one can think at it as user level operator. Unlike @ the replace method is not implemented for $.
Id of the resource. Character string, though it will always be an integer.
Name of the selected resource.
Location of the resource in the API. The first component of the URI is the version of the REST API.
When this resource was created. Character string. It can be converted to a Date instace by as.Date(DateCreated(x)).
Information about the User who owns this resource. At this moment this is a list object, but it might be replace with an object at a future point.
The status of the resource. Can be of any type and it will be defined by the classes extended Item.
The location of this project in BaseSpace. Character string giving the complete URL within the BaseSpace dashboard.

Collection Accessors

The Collection class models an ordered set of Item objects and a set of predefined attributes. The interface provided by the Item class is implemented by this class. However, since we deal with an ordered set of objects, the methods and the access methods, return a vector of the same length as the size of the collection. In the following x is a Collection object. All accesor implemented by the item class are implemented by Collection class. However here the return value is a vector. If x has 2 elements, then Id(x) will be a vector with 2 elements. The same stands for the general accessor $.
Returns the number of elements in Collection x.
List of Item objects.
The total number of items in the collection as reported by the queried resource.
The starting point the collection was read from.
The maximum number of items returned. Ranges from 0 to 1024.
The way the collection is sorted, either ascending or descending.
The field to use to sort the collection.


Comming soon ...


Returns the number of elements in Collection x.
Prints the object.
R list representation of the object.