Particle.ParticleCloud.ClaimDeviceAsync C# (CSharp) Méthode

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
		public async Task<Result> ClaimDeviceAsync(String deviceId)
		{
			if (String.IsNullOrWhiteSpace(deviceId))
			{
				throw new ArgumentNullException(nameof(deviceId));
			}

			try
			{
				var result = await MakePostRequestWithAuthTestAsync("devices", new KeyValuePair<string, string>("id", deviceId));
				var userResult = result.AsResult();
				return userResult;
			}
			catch (HttpRequestException re)
			{
				return new Result
				{
					Success = false,
					Error = re.Message,
					Exception = re
				};
			}
		}