/// <summary> /// Sets status of a given operation. Any new timestamps (as determined by description) are appended to TimestampEvents. Should only be called by VMs created by the Pipelines Service and not by end users. /// Documentation https://developers.google.com/genomics/v1alpha2/reference/pipelines/setOperationStatus /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated genomics service.</param> /// <param name="body">A valid genomics v1alpha2 body.</param> /// <returns>EmptyResponse</returns> public static Empty SetOperationStatus(genomicsService service, SetOperationStatusRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } // Make the request. return(service.Pipelines.SetOperationStatus(body).Execute()); } catch (Exception ex) { throw new Exception("Request Pipelines.SetOperationStatus failed.", ex); } }
public async ValueTask <OperationResponse> SetKycStatusesAsync(SetOperationStatusRequest request) { _logger.LogInformation("Manually setting operation statuses for clientId {clientId}", request.ClientId); try { var profile = await _repository.GetOrCreateProfile(request.ClientId); var oldProfile = (KycProfile)profile.Clone(); profile.DepositStatus = request.DepositStatus; profile.TradeStatus = request.TradeStatus; profile.WithdrawalStatus = request.WithdrawalStatus; await _repository.UpdateProfile(profile, "Manual kyc status change", request.Agent, request.Comment); await _publisher.PublishAsync(new KycProfileUpdatedMessage() { ClientId = request.ClientId, OldProfile = oldProfile, NewProfile = profile }); return(new OperationResponse() { IsSuccess = true }); } catch (Exception e) { _logger.LogError(e, "When manually setting kyc status for clientId {clientId}", request.ClientId); return(new OperationResponse() { IsSuccess = false, Error = e.Message }); } }