C# Class Particle.ParticleCloud

Represents the connection to the particle cloud.
Inheritance: ParticleBase, IDisposable
Afficher le fichier Open project: ParticleNET/ParticleSDK Class Usage Examples

Méthodes publiques

Méthode Description
ClaimDeviceAsync ( String deviceId ) : Task

Claims the specified device for the logged in user

Dispose ( ) : void

Releases unmanaged and - optionally - managed resources mainly the underlining HttpClient

GetDevicesAsync ( ) : Task>>

Get the list of devices the user has access to

LoginWithUserAsync ( String username, String password, int expiresIn = 3600 ) : Task

Logs into ParticleCloud with the given username and password

Logout ( ) : void

Logs the user out locally

MakeDeleteRequestAsync ( String method ) : Task

Makes the delete request asynchronous to the particle cloud

MakeDeleteRequestWithAuthTestAsync ( String method ) : Task

Calls MakeDeleteRequestAsync(string) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again

MakeGetRequestAsync ( String method ) : Task

Makes the get request asynchronous to the cloud api

MakeGetRequestWithAuthTestAsync ( String method ) : Task

Calls MakeGetRequestAsync(string) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again

MakePostRequestAsync ( String method ) : Task

Makes the post request asynchronous to the particle cloud

MakePostRequestWithAuthTestAsync ( String method ) : Task

Calls MakePostRequestAsync(string, KeyValuePair{string, string}[]) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again

MakePostRequestWithoutAuthAsync ( String method ) : Task

Makes the post request without authentication asynchronous to the particle cloud.

MakePutRequestAsync ( String method ) : Task

Makes the put request asynchronous to the particle cloud

MakePutRequestWithAuthTestAsync ( String method ) : Task

Calls MakePutRequestAsync(string, KeyValuePair{string, string}[]) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again

ParticleCloud ( ) : Newtonsoft.Json

Initializes a new instance of the ParticleCloud class using the default url https://api.particle.io/v1/

ParticleCloud ( Uri baseUri ) : Newtonsoft.Json

Initializes a new instance of the ParticleCloud class.

RefreshTokenAsync ( ) : Task

Refreshes the access token asynchronous.

RequestPasswordResetAsync ( String email ) : Task

Requests the password be reset.

SignupWithUserAsync ( String username, String password ) : Task

Sign up with new account credentials to Particle cloud

Method Details

ClaimDeviceAsync() public méthode

Claims the specified device for the logged in user
public ClaimDeviceAsync ( String deviceId ) : Task
deviceId String The id of the new device
Résultat Task

Dispose() public méthode

Releases unmanaged and - optionally - managed resources mainly the underlining HttpClient
public Dispose ( ) : void
Résultat void

GetDevicesAsync() public méthode

Get the list of devices the user has access to
public GetDevicesAsync ( ) : Task>>
Résultat Task>>

LoginWithUserAsync() public méthode

Logs into ParticleCloud with the given username and password
public LoginWithUserAsync ( String username, String password, int expiresIn = 3600 ) : Task
username String The Particle account username
password String The Particle account password
expiresIn int How many seconds the token will be valid for. 0 means forever. Short lived tokens are better for security.
Résultat Task

Logout() public méthode

Logs the user out locally
public Logout ( ) : void
Résultat void

MakeDeleteRequestAsync() public méthode

Makes the delete request asynchronous to the particle cloud
public MakeDeleteRequestAsync ( String method ) : Task
method String The method.
Résultat Task

MakeDeleteRequestWithAuthTestAsync() public méthode

Calls MakeDeleteRequestAsync(string) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again
public MakeDeleteRequestWithAuthTestAsync ( String method ) : Task
method String The method to call
Résultat Task

MakeGetRequestAsync() public méthode

Makes the get request asynchronous to the cloud api
public MakeGetRequestAsync ( String method ) : Task
method String The method to call i.e. devices
Résultat Task

MakeGetRequestWithAuthTestAsync() public méthode

Calls MakeGetRequestAsync(string) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again
public MakeGetRequestWithAuthTestAsync ( String method ) : Task
method String The method to call
Résultat Task

MakePostRequestAsync() public méthode

Makes the post request asynchronous to the particle cloud
public MakePostRequestAsync ( String method ) : Task
method String The method to call
Résultat Task

MakePostRequestWithAuthTestAsync() public méthode

Calls MakePostRequestAsync(string, KeyValuePair{string, string}[]) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again
public MakePostRequestWithAuthTestAsync ( String method ) : Task
method String The method to call
Résultat Task

MakePostRequestWithoutAuthAsync() public méthode

Makes the post request without authentication asynchronous to the particle cloud.
public MakePostRequestWithoutAuthAsync ( String method ) : Task
method String The method.
Résultat Task

MakePutRequestAsync() public méthode

Makes the put request asynchronous to the particle cloud
public MakePutRequestAsync ( String method ) : Task
method String The method to call
Résultat Task

MakePutRequestWithAuthTestAsync() public méthode

Calls MakePutRequestAsync(string, KeyValuePair{string, string}[]) and if it returns a status code of Unauthorized try s to refresh the token and makes the request again
public MakePutRequestWithAuthTestAsync ( String method ) : Task
method String The method to call
Résultat Task

ParticleCloud() public méthode

Initializes a new instance of the ParticleCloud class using the default url https://api.particle.io/v1/
public ParticleCloud ( ) : Newtonsoft.Json
Résultat Newtonsoft.Json

ParticleCloud() public méthode

Initializes a new instance of the ParticleCloud class.
public ParticleCloud ( Uri baseUri ) : Newtonsoft.Json
baseUri System.Uri The url to the particle sdk i.e. https://api.particle.io/v1/
Résultat Newtonsoft.Json

RefreshTokenAsync() public méthode

Refreshes the access token asynchronous.
public RefreshTokenAsync ( ) : Task
Résultat Task

RequestPasswordResetAsync() public méthode

Requests the password be reset.
public RequestPasswordResetAsync ( String email ) : Task
email String The email.
Résultat Task

SignupWithUserAsync() public méthode

Sign up with new account credentials to Particle cloud
public SignupWithUserAsync ( String username, String password ) : Task
username String Required user name, must be a valid email address
password String Required password
Résultat Task