C# Class Syncano.Net.Api.DataObjectSyncanoClient

Class with DataObject management api.
Mostra file Open project: Syncano/syncano-dotnet Class Usage Examples

Public Methods

Method Description
AddChild ( string projectId, string dataId, string childId, string collectionId = null, string collectionKey = null, bool removeOther = false ) : Task

Adds additional child to data with specified data_id. If remove_other is True, all other children of specified Data Object will be removed. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that child is added to is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, child itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).

AddParent ( string projectId, string dataId, string parentId, string collectionId = null, string collectionKey = null, bool removeOther = false ) : Task

Adds additional parent to data with specified data_id. If remove_other is True, all other parents of specified Data Object will be removed. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that parent is added to is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, parent itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).

Copy ( CopyDataObjectRequest request ) : Task>

Copies data with a specified data_id. Copies have their data_key cleared. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Can copy only data that are in a container with a read_data permission (or read_own_data for Data Objects associated with current user). Target container also needs to have create_data permission.

Count ( CountDataObjectRequest request ) : Task

Counts data of specified criteria. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Counts only Data Objects that are in a container with a read_data permission and associated with current user Data Objects that are in a container with``read_own_data`` permission.

DataObjectSyncanoClient ( ISyncanoClient syncanoClient ) : System

Creates DataObjectSyncanoClient object.

Delete ( DataObjectSimpleQueryRequest request ) : Task

Deletes a Data Object. If no filters are specified, will process all Data Objects in defined collection(s) (up to defined limit). The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Deletes only Data Objects that are in a container with a delete_data permission and associated with current user Data Objects that are in a container with delete_own_data permission.

Get ( DataObjectRichQueryRequest request ) : Task>

Get data from collection(s) or whole project with optional additional filtering. All filters, unless explicitly noted otherwise, affect all hierarchy levels. To paginate and to get more data, use since parameter. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Returns Data Objects that are in a container with a read_data permission and associated with current user Data Objects that are in a container with a read_own_data permission.

GetOne ( string projectId, string collectionId = null, string collectionKey = null, string dataId = null, string dataKey = null, bool includeChildren = false, int depth = null, int childrenLimit = 100 ) : Task

Get data by data_id or data_key. Either data_id or data_key has to be specified. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Returns Data Object if it is in a container with a read_data permission or is associated with current user and in a container with a read_own_data permission.

Merge ( DataObjectDefinitionRequest request, string dataId = null ) : Task

Updates an existing Data Object if data with a specified data_id or data_key already exists. Will not delete/empty previously set data but merge it instead with new data.

Move ( DataObjectSimpleQueryRequest request, string newFolder = null, DataObjectState newState = null ) : Task

Moves data to a folder and/or state. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Updates only data that are in a container with an update_data permission (or update_own_data for Data Objects associated with current user).

New ( DataObjectDefinitionRequest request ) : Task

Creates a new Data Object. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Requires create_data permission added through folder.authorize(), collection.authorize() or project.authorize(). user_name field is automatically filled in with current user's info.

RemoveChild ( string projectId, string dataId, string childId = null, string collectionId = null, string collectionKey = null ) : Task

Removes a child (or children) from data with specified data_id. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that child is removed from is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, child itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).

RemoveParent ( string projectId, string dataId, string parentId = null, string collectionId = null, string collectionKey = null ) : Task

Removes a parent (or parents) from data with specified data_id. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that parent is removed from is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, parent itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).

ToString ( ) : string
Update ( DataObjectDefinitionRequest request, string dataId = null ) : Task

Updates an existing Data Object if data with a specified data_id or data_key already exists. Will delete all Data Object fields and create a new one in its place (no previous data will remain).

Private Methods

Method Description
AssertAditionals ( string>.Dictionary additionals ) : void

Method Details

AddChild() public method

Adds additional child to data with specified data_id. If remove_other is True, all other children of specified Data Object will be removed. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that child is added to is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, child itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).
public AddChild ( string projectId, string dataId, string childId, string collectionId = null, string collectionKey = null, bool removeOther = false ) : Task
projectId string Project id.
dataId string Data Object id.
childId string Child id to add.
collectionId string Collection id defining collection containing data.
collectionKey string Collection key defining collection containing data.
removeOther bool If true, will remove all other children. Default value: False.
return Task

AddParent() public method

Adds additional parent to data with specified data_id. If remove_other is True, all other parents of specified Data Object will be removed. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that parent is added to is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, parent itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).
public AddParent ( string projectId, string dataId, string parentId, string collectionId = null, string collectionKey = null, bool removeOther = false ) : Task
projectId string Project id.
dataId string Data Object id.
parentId string Parent id to add.
collectionId string Collection id defining collection containing data.
collectionKey string Collection key defining collection containing data.
removeOther bool If true, will remove all other parents. Default value: False.
return Task

Copy() public method

Copies data with a specified data_id. Copies have their data_key cleared. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Can copy only data that are in a container with a read_data permission (or read_own_data for Data Objects associated with current user). Target container also needs to have create_data permission.
public Copy ( CopyDataObjectRequest request ) : Task>
request Syncano.Net.DataRequests.CopyDataObjectRequest Request for querying DataObjects.
return Task>

Count() public method

Counts data of specified criteria. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Counts only Data Objects that are in a container with a read_data permission and associated with current user Data Objects that are in a container with``read_own_data`` permission.
public Count ( CountDataObjectRequest request ) : Task
request Syncano.Net.DataRequests.CountDataObjectRequest Request for counting DataObjects.
return Task

DataObjectSyncanoClient() public method

Creates DataObjectSyncanoClient object.
public DataObjectSyncanoClient ( ISyncanoClient syncanoClient ) : System
syncanoClient ISyncanoClient Object implementing ISyncanoClient interface. Provides means for connecting to Syncano.
return System

Delete() public method

Deletes a Data Object. If no filters are specified, will process all Data Objects in defined collection(s) (up to defined limit). The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Deletes only Data Objects that are in a container with a delete_data permission and associated with current user Data Objects that are in a container with delete_own_data permission.
public Delete ( DataObjectSimpleQueryRequest request ) : Task
request Syncano.Net.DataRequests.DataObjectSimpleQueryRequest Request for querying DataObjects.
return Task

Get() public method

Get data from collection(s) or whole project with optional additional filtering. All filters, unless explicitly noted otherwise, affect all hierarchy levels. To paginate and to get more data, use since parameter. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Returns Data Objects that are in a container with a read_data permission and associated with current user Data Objects that are in a container with a read_own_data permission.
public Get ( DataObjectRichQueryRequest request ) : Task>
request Syncano.Net.DataRequests.DataObjectRichQueryRequest Request for querying data objects.
return Task>

GetOne() public method

Get data by data_id or data_key. Either data_id or data_key has to be specified. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Returns Data Object if it is in a container with a read_data permission or is associated with current user and in a container with a read_own_data permission.
public GetOne ( string projectId, string collectionId = null, string collectionKey = null, string dataId = null, string dataKey = null, bool includeChildren = false, int depth = null, int childrenLimit = 100 ) : Task
projectId string Project id.
collectionId string Collection idy defining a collection for which data will be returned.
collectionKey string Collection key defining a collection for which data will be returned.
dataId string Data Object's id.
dataKey string Data Object's key.
includeChildren bool If true, include Data Object children as well (recursively). Default value: False. Max 100 of children are shown in one request.
depth int Max depth of children to follow. If not specified, will follow all levels until children limit is reached.
childrenLimit int Limit of children to show (if include_children is True). Default and max value: 100 (some children levels may be incomplete if there are more than this limit).
return Task

Merge() public method

Updates an existing Data Object if data with a specified data_id or data_key already exists. Will not delete/empty previously set data but merge it instead with new data.
public Merge ( DataObjectDefinitionRequest request, string dataId = null ) : Task
request Syncano.Net.DataRequests.DataObjectDefinitionRequest Request for defining new data object properties.
dataId string Data id. If both id and key are specified, will use id for getting object while data_key will be updated with provided new value. data_key has to be unique within collection.
return Task

Move() public method

Moves data to a folder and/or state. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Updates only data that are in a container with an update_data permission (or update_own_data for Data Objects associated with current user).
public Move ( DataObjectSimpleQueryRequest request, string newFolder = null, DataObjectState newState = null ) : Task
request Syncano.Net.DataRequests.DataObjectSimpleQueryRequest Request for querying DataObjects.
newFolder string Destination folder where data will be moved. If not specified, leaves folder as is.
newState DataObjectState State to be set data for specified data. Accepted values: Pending, Moderated. If not specified, leaves state as is.
return Task

New() public method

Creates a new Data Object. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Requires create_data permission added through folder.authorize(), collection.authorize() or project.authorize(). user_name field is automatically filled in with current user's info.
public New ( DataObjectDefinitionRequest request ) : Task
request Syncano.Net.DataRequests.DataObjectDefinitionRequest Request defining new object.
return Task

RemoveChild() public method

Removes a child (or children) from data with specified data_id. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that child is removed from is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, child itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).
public RemoveChild ( string projectId, string dataId, string childId = null, string collectionId = null, string collectionKey = null ) : Task
projectId string Project id.
dataId string Data Object id.
childId string Child id to remove. If not specified, will remove all Data Object children.
collectionId string Collection id defining collection containing data.
collectionKey string Collection key defining collection containing data.
return Task

RemoveParent() public method

Removes a parent (or parents) from data with specified data_id. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key. User API key usage permitted. Data Object that parent is removed from is required to be in a container with an update_data permission or (or update_own_data if it is associated with current user). Also, parent itself is required to be in a container with a (read_data permission or read_own_data if it is associated with current user).
public RemoveParent ( string projectId, string dataId, string parentId = null, string collectionId = null, string collectionKey = null ) : Task
projectId string Project id.
dataId string Data Object id.
parentId string Parent id to remove. If not specified, will remove all Data Object parents.
collectionId string Collection id defining collection containing data.
collectionKey string Collection key defining collection containing data.
return Task

ToString() public method

public ToString ( ) : string
return string

Update() public method

Updates an existing Data Object if data with a specified data_id or data_key already exists. Will delete all Data Object fields and create a new one in its place (no previous data will remain).
public Update ( DataObjectDefinitionRequest request, string dataId = null ) : Task
request Syncano.Net.DataRequests.DataObjectDefinitionRequest Request for defining new data object properties.
dataId string Data id. If both id and key are specified, will use id for getting object while data_key will be updated with provided new value. data_key has to be unique within collection.
return Task