Public Member Functions | Static Public Member Functions | List of all members
dx::DXRecord Class Reference

A minimal data object. More...

#include <dxrecord.h>

Inheritance diagram for dx::DXRecord:
dx::DXDataObject

Public Member Functions

 DXRecord (const char *dxid, const char *proj=NULL)
 
 DXRecord (const std::string &dxid, const std::string &proj=config::CURRENT_PROJECT())
 
 DXRecord (const dx::JSON &dxlink)
 
void create (const dx::JSON &data_obj_fields=dx::JSON(dx::JSON_OBJECT))
 
void create (const DXRecord &init_from, const dx::JSON &data_obj_fields=dx::JSON(dx::JSON_OBJECT))
 
DXRecord clone (const std::string &dest_proj_id, const std::string &dest_folder="/") const
 
- Public Member Functions inherited from dx::DXDataObject
 DXDataObject (const DXDataObject &to_copy)
 
 DXDataObject (const std::string &dxid)
 
 DXDataObject (const std::string &dxid, const std::string &proj)
 
std::string getID () const
 
 operator std::string ()
 
std::string getProjectID () const
 
virtual void setIDs (const std::string &dxid, const std::string &proj="default")
 
virtual void setIDs (const char *dxid, const char *proj=NULL)
 
virtual void setIDs (const JSON &dxlink)
 
JSON describe (bool incl_properties=false, bool incl_details=false) const
 
void addTypes (const JSON &types) const
 
void removeTypes (const JSON &types) const
 
JSON getDetails () const
 
void setDetails (const JSON &details) const
 
void hide () const
 
void unhide () const
 
void rename (const std::string &name) const
 
void setProperties (const JSON &properties) const
 
JSON getProperties () const
 
void addTags (const JSON &tags) const
 
void removeTags (const JSON &tags) const
 
virtual void close () const
 
JSON listProjects () const
 
void move (const std::string &dest_folder) const
 
void remove ()
 

Static Public Member Functions

static DXRecord newDXRecord (const dx::JSON &data_obj_fields=dx::JSON(dx::JSON_OBJECT))
 
static DXRecord newDXRecord (const DXRecord &init_from, const dx::JSON &data_obj_fields=dx::JSON(dx::JSON_OBJECT))
 

Additional Inherited Members

- Protected Member Functions inherited from dx::DXDataObject
void waitOnState (const std::string &state="closed", const int timeout=std::numeric_limits< int >::max()) const
 
void clone_ (const std::string &dest_proj_id, const std::string &dest_folder) const
 
- Protected Attributes inherited from dx::DXDataObject
std::string dxid_
 
std::string proj_
 

Detailed Description

A minimal data object.

A record stores no additional data, nor does it have any additional routes beyond those common to all data objects. A record object can store data in its details (see DXDataObject::setDetails and DXDataObject::getDetails) and can thereby act as an object containing metadata and links to other objects.

Constructor & Destructor Documentation

dx::DXRecord::DXRecord ( const char *  dxid,
const char *  proj = NULL 
)
inline

Creates a new DXRecord handler for the specified remote record object.

Parameters
dxidRecord ID.
projID of the project in which to access the object (if NULL, then default workspace will be used).
dx::DXRecord::DXRecord ( const std::string &  dxid,
const std::string &  proj = config::CURRENT_PROJECT() 
)
inline

Creates a new DXRecord handler for the specified remote record object.

Parameters
dxidRecord ID.
projID of the project in which to access the object.
dx::DXRecord::DXRecord ( const dx::JSON &  dxlink)
inline

Creates a new DXRecord handler for the specified remote record object.

Parameters
dxlinkA JSON representing a DNAnexus link. You may also use the extended form: {"$dnanexus_link": {"project": proj-id, "id": obj-id}}.

Member Function Documentation

DXRecord dx::DXRecord::clone ( const std::string &  dest_proj_id,
const std::string &  dest_folder = "/" 
) const

Clones the remote record into the specified project and folder.

Parameters
dest_proj_idID of the project to which the object should be cloned.
dest_folderFolder route in which to put it in the destination project.
Returns
New object handler with the associated project set to dest_proj_id.
void dx::DXRecord::create ( const dx::JSON &  data_obj_fields = dx::JSON(dx::JSON_OBJECT))

Creates a new remote record object. The handler is updated with the object ID.

Parameters
data_obj_fieldsJSON containing the optional fields with which to create the object ("project", "types", "details", "hidden", "name", "properties", "tags"), as provided to the /record/new API method.
void dx::DXRecord::create ( const DXRecord init_from,
const dx::JSON &  data_obj_fields = dx::JSON(dx::JSON_OBJECT) 
)

Creates a new remote record object, initializing it from the specified record (and overriding with any values that are present in data_obj_fields). The handler is updated with the object ID.

Parameters
init_froma DXRecord from which to initialize the metadata
data_obj_fieldsJSON containing the optional fields with which to create the object ("project", "types", "details", "hidden", "name", "properties", "tags"), as provided to the /record/new API method.
static DXRecord dx::DXRecord::newDXRecord ( const dx::JSON &  data_obj_fields = dx::JSON(dx::JSON_OBJECT))
static

Creates a new remote record. Returns a handler for the new object.

Parameters
data_obj_fieldsJSON containing the optional fields with which to create the object ("project", "types", "details", "hidden", "name", "properties", "tags"), as provided to the /record/new API method.
Returns
A DXRecord remote object handler.
static DXRecord dx::DXRecord::newDXRecord ( const DXRecord init_from,
const dx::JSON &  data_obj_fields = dx::JSON(dx::JSON_OBJECT) 
)
static

Creates a new remote record object, initializing it from the specified record (and overriding with any values that are present in data_obj_fields). Returns a handler for the new remote object.

Parameters
init_froma DXRecord from which to initialize the metadata.
data_obj_fieldsJSON containing the optional fields with which to create the object ("project", "types", "details", "hidden", "name", "properties", "tags"), as provided to the /record/new API method.
Returns
A DXRecord remote object handler.

The documentation for this class was generated from the following files: