C# Class Syncano.Net.Api.ApiKeySyncanoClient

Class with ApiKey management api.
Afficher le fichier Open project: Syncano/syncano-dotnet Class Usage Examples

Méthodes publiques

Méthode Description
ApiKeySyncanoClient ( ISyncanoClient syncanoClient ) : System

Creates ApiKeySyncanoClient object.

Authorize ( string apiClientId, ApiKeyPermission permission ) : Task

Adds permission to specified User API client. Requires Backend API key with Admin permission role.

ClearSession ( ) : void

Clears current Session Id.

Deauthorize ( string apiClientId, ApiKeyPermission permission ) : Task

Removes permission from specified User API client. Requires Backend API key with Admin permission role.

Delete ( string apiClientId ) : Task

Deletes specified API client. Only Admin permission role can delete API clients.

Get ( ) : Task>

Get API clients. Only Admin permission role can view other API clients.

GetOne ( string apiClientId = null ) : Task

Gets info of one specified API client. Only Admin permission role can view other API clients.

GetRoles ( ) : Task>

Lists all permission roles of current instance.

New ( string description, ApiKeyType type = ApiKeyType.Backend, string roleId = null ) : Task

Creates a new API client (for backend or user-aware usage) in current instance. Only Admin permission role can create new API clients.

StartSession ( TimeZoneInfo timeZone = null ) : Task

Logs in the API client and returns session_id for session id or cookie-based authentication. Session is valid for 2 hours and is automatically renewed whenever it is used. User API key usage permitted.

UpdateDescription ( string description, string apiClientId = null ) : Task

Updates specified API client's info.

Method Details

ApiKeySyncanoClient() public méthode

Creates ApiKeySyncanoClient object.
public ApiKeySyncanoClient ( ISyncanoClient syncanoClient ) : System
syncanoClient ISyncanoClient Object implementing ISyncanoClient interface. Provides means for connecting to Syncano.
Résultat System

Authorize() public méthode

Adds permission to specified User API client. Requires Backend API key with Admin permission role.
public Authorize ( string apiClientId, ApiKeyPermission permission ) : Task
apiClientId string User API client id.
permission ApiKeyPermission User API client's permission to add.
Résultat Task

ClearSession() public méthode

Clears current Session Id.
public ClearSession ( ) : void
Résultat void

Deauthorize() public méthode

Removes permission from specified User API client. Requires Backend API key with Admin permission role.
public Deauthorize ( string apiClientId, ApiKeyPermission permission ) : Task
apiClientId string User API client id.
permission ApiKeyPermission User API client's permission to remove.
Résultat Task

Delete() public méthode

Deletes specified API client. Only Admin permission role can delete API clients.
public Delete ( string apiClientId ) : Task
apiClientId string API client id defining API client to delete.
Résultat Task

Get() public méthode

Get API clients. Only Admin permission role can view other API clients.
public Get ( ) : Task>
Résultat Task>

GetOne() public méthode

Gets info of one specified API client. Only Admin permission role can view other API clients.
public GetOne ( string apiClientId = null ) : Task
apiClientId string API client id. If not specified, will use current API client.
Résultat Task

GetRoles() public méthode

Lists all permission roles of current instance.
public GetRoles ( ) : Task>
Résultat Task>

New() public méthode

Creates a new API client (for backend or user-aware usage) in current instance. Only Admin permission role can create new API clients.
public New ( string description, ApiKeyType type = ApiKeyType.Backend, string roleId = null ) : Task
description string Description of new API client.
type ApiKeyType Type of new API client.
roleId string New API client's permission role id (see role.get()). Not used when creating User API key (type = user)
Résultat Task

StartSession() public méthode

Logs in the API client and returns session_id for session id or cookie-based authentication. Session is valid for 2 hours and is automatically renewed whenever it is used. User API key usage permitted.
public StartSession ( TimeZoneInfo timeZone = null ) : Task
timeZone System.TimeZoneInfo Sets default timezone for all subsequent requests using returned session_id.
Résultat Task

UpdateDescription() public méthode

Updates specified API client's info.
public UpdateDescription ( string description, string apiClientId = null ) : Task
description string New API client's description to set.
apiClientId string API client id. If not specified, will update current API client.
Résultat Task