/// <summary> /// Posts Device to server /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='deviceEntity'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <DeviceEntity> ApiDevicePostAsync(this IHomeAutomationAPI operations, DeviceEntity deviceEntity = default(DeviceEntity), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ApiDevicePostWithHttpMessagesAsync(deviceEntity, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }