public virtual ApiDeviceClientRequestModel MapClientResponseToRequest( ApiDeviceClientResponseModel response) { var request = new ApiDeviceClientRequestModel(); request.SetProperties( response.DateOfLastPing, response.IsActive, response.Name, response.PublicId); return(request); }
public virtual ApiDeviceClientResponseModel MapClientRequestToResponse( int id, ApiDeviceClientRequestModel request) { var response = new ApiDeviceClientResponseModel(); response.SetProperties(id, request.DateOfLastPing, request.IsActive, request.Name, request.PublicId); return(response); }
public virtual async Task <UpdateResponse <ApiDeviceClientResponseModel> > DeviceUpdateAsync(int id, ApiDeviceClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken)) { HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Devices/{id}", item, cancellationToken).ConfigureAwait(false); this.HandleResponseCode(httpResponse); return(JsonConvert.DeserializeObject <UpdateResponse <ApiDeviceClientResponseModel> >(httpResponse.Content.ContentToString())); }