public async Task <MessageResponse> UpdateAsync(int annotationId, UpdateAnnotationRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } var response = await ExecutePutRequestAsync <MessageResponse, UpdateAnnotationRequest>($"/api/annotations/{annotationId}", null, request, _authentication); return(response); }
public MessageResponse Update(int annotationId, UpdateAnnotationRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } var task = Task.Run(() => UpdateAsync(annotationId, request)); task.Wait(); return(task.Result); }
protected override void ProcessRecord() { base.ProcessRecord(); UpdateAnnotationRequest request; try { request = new UpdateAnnotationRequest { AnnotationId = AnnotationId, UpdateAnnotationDetails = UpdateAnnotationDetails, IfMatch = IfMatch, OpcRequestId = OpcRequestId }; response = client.UpdateAnnotation(request).GetAwaiter().GetResult(); WriteOutput(response, response.Annotation); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }