C# Class Syncano.Net.Api.UserSyncanoClient

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

Public Methods

Method Description
Count ( UserQueryRequest request ) : Task

Count users of specified criteria. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key.

Delete ( string userId = null, string userName = null ) : Task

Deletes (permanently) specified user and all associated data objects. The user_id/user_name parameter means that one can use either one of them - user_id or user_name. User API key usage permitted. In this case, it can only be used to update currently associated user. User_id is automatically filled with current user's id.

Get ( UserQueryRequest request ) : Task>

Gets users of specified criteria that are associated with Data Objects within specified collection. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key.

GetAll ( string sinceId = null, long limit = MaxLimit ) : Task>

Gets all users from within instance. To paginate and to get more data, use since_id.

GetOne ( string userId = null, string userName = null ) : Task

Get one user. User API key usage permitted. In this case, it can only be used to get currently associated user's data. All parameters are optional. The user_id/user_name parameter means that one can use either one of them - user_id or user_name.

Login ( string userName, string password ) : Task

Logs in a user. This method is intended for User API key usage.

New ( string userName, string password = null, string nick = null, string avatar = null ) : Task

Creates a new user. User API key usage permitted if add_user permission is added through apikey.authorize().

Update ( string userId = null, string userName = null, string nick = null, string avatar = null, string newPassword = null, string currentPassword = null ) : Task

Updates a specified user. User API key usage permitted. In this case, it can only be used to update currently associated user's data. User_id is automatically filled with current user's id. The user_id/user_name parameter means that one can use either one of them - user_id or user_name.

UserSyncanoClient ( ISyncanoClient syncanoClient ) : System

Creates UserSyncanoClient object.

Method Details

Count() public method

Count users of specified criteria. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key.
public Count ( UserQueryRequest request ) : Task
request Syncano.Net.DataRequests.UserQueryRequest User query request object.
return Task

Delete() public method

Deletes (permanently) specified user and all associated data objects. The user_id/user_name parameter means that one can use either one of them - user_id or user_name. User API key usage permitted. In this case, it can only be used to update currently associated user. User_id is automatically filled with current user's id.
public Delete ( string userId = null, string userName = null ) : Task
userId string User id defining user to delete. User_id is automatically filled when used with User API key.
userName string User name defining user to delete.
return Task

Get() public method

Gets users of specified criteria that are associated with Data Objects within specified collection. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key.
public Get ( UserQueryRequest request ) : Task>
request Syncano.Net.DataRequests.UserQueryRequest User query request object.
return Task>

GetAll() public method

Gets all users from within instance. To paginate and to get more data, use since_id.
public GetAll ( string sinceId = null, long limit = MaxLimit ) : Task>
sinceId string If specified, will only return users with id higher than since_id (newer).
limit long Number of users to be returned. Default and max value: 100
return Task>

GetOne() public method

Get one user. User API key usage permitted. In this case, it can only be used to get currently associated user's data. All parameters are optional. The user_id/user_name parameter means that one can use either one of them - user_id or user_name.
public GetOne ( string userId = null, string userName = null ) : Task
userId string User id. User_id is automatically filled when used with User API key.
userName string User name.
return Task

Login() public method

Logs in a user. This method is intended for User API key usage.
public Login ( string userName, string password ) : Task
userName string User name.
password string User's password.
return Task

New() public method

Creates a new user. User API key usage permitted if add_user permission is added through apikey.authorize().
public New ( string userName, string password = null, string nick = null, string avatar = null ) : Task
userName string User name.
password string User's password.
nick string User's nickname.
avatar string User's avatar in Base64 format.
return Task

Update() public method

Updates a specified user. User API key usage permitted. In this case, it can only be used to update currently associated user's data. User_id is automatically filled with current user's id. The user_id/user_name parameter means that one can use either one of them - user_id or user_name.
public Update ( string userId = null, string userName = null, string nick = null, string avatar = null, string newPassword = null, string currentPassword = null ) : Task
userId string User id defining user. If both id and name are specified, will use id for getting user while user_name will be updated with provided new value. User_id is automatically filled when used with User API key.
userName string User name defining user. If both id and name are specified, will use id for getting user while user_name will be updated with provided new value.
nick string New user nickname.
avatar string User avatar. If specified as empty string - will instead delete current avatar.
newPassword string New user password.
currentPassword string Current password for confirmation. Required only when used with User API key and new_password is specified.
return Task

UserSyncanoClient() public method

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