public object Get(OfflineDeploymentRequest request) { if(request == null) { throw new ArgumentNullException("request is null"); } if(!string.IsNullOrEmpty(request.Id)) { return _offlineDeploymentManager.GetOfflineDeployment(request.Id); } else if(!string.IsNullOrEmpty(request.DeployBatchRequestId)) { return _offlineDeploymentManager.GetOfflineDeploymentForDeploymentBatchRequestId(request.DeployBatchRequestId); } else { throw new ArgumentNullException("request.id and request.deployBatchRequestId are null"); } }
private OfflineDeployment Save(OfflineDeploymentRequest data) { if(data == null) { throw new ArgumentNullException("request is null"); } if(!string.IsNullOrEmpty(data.Id)) { if(string.IsNullOrEmpty(data.ResultFileId)) { throw new ArgumentNullException("request.resultFileId is null"); } return _offlineDeploymentManager.ImportHistory(data.Id, data.ResultFileId); } else if (!string.IsNullOrEmpty(data.DeployBatchRequestId)) { return _offlineDeploymentManager.BeginCreateOfflineDeployment(data.DeployBatchRequestId); } else { throw new ArgumentNullException("request.id and request.deployBatchRequestId are null"); } }
public object Post(OfflineDeploymentRequest data) { return Save(data); }