public async Task UpdateJobAsync() { Mock <JobController.JobControllerClient> mockGrpcClient = new Mock <JobController.JobControllerClient>(MockBehavior.Strict); UpdateJobRequest request = new UpdateJobRequest { ProjectId = "projectId-1969970175", Region = "region-934795532", JobId = "jobId-1154752291", Job = new Job(), UpdateMask = new FieldMask(), }; Job expectedResponse = new Job { DriverOutputResourceUri = "driverOutputResourceUri-542229086", DriverControlFilesUri = "driverControlFilesUri207057643", JobUuid = "jobUuid-1615012099", }; mockGrpcClient.Setup(x => x.UpdateJobAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <Job>(Task.FromResult(expectedResponse), null, null, null, null)); JobControllerClient client = new JobControllerClientImpl(mockGrpcClient.Object, null); Job response = await client.UpdateJobAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// You use this operation to change the parameters specified in the original manifest /// file by supplying a new manifest file. The manifest file attached to this request /// replaces the original manifest file. You can only use the operation after a CreateJob /// request but before the data transfer starts and you can only use it on jobs you own. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJob service method.</param> /// /// <returns>The response from the UpdateJob service method, as returned by ImportExport.</returns> /// <exception cref="Amazon.ImportExport.Model.BucketPermissionException"> /// The account specified does not have the appropriate bucket permissions. /// </exception> /// <exception cref="Amazon.ImportExport.Model.CanceledJobIdException"> /// The specified job ID has been canceled and is no longer valid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.ExpiredJobIdException"> /// Indicates that the specified job has expired out of the system. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidAccessKeyIdException"> /// The AWS Access Key ID specified in the request did not match the manifest's accessKeyId /// value. The manifest and the request authentication must use the same AWS Access Key /// ID. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidAddressException"> /// The address specified in the manifest is invalid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidCustomsException"> /// One or more customs parameters was invalid. Please correct and resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidFileSystemException"> /// File system specified in export manifest is invalid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidJobIdException"> /// The JOBID was missing, not found, or not associated with the AWS account. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidManifestFieldException"> /// One or more manifest fields was invalid. Please correct and resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidParameterException"> /// One or more parameters had an invalid value. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidVersionException"> /// The client tool version is invalid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MalformedManifestException"> /// Your manifest is not well-formed. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MissingCustomsException"> /// One or more required customs parameters was missing from the manifest. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MissingManifestFieldException"> /// One or more required fields were missing from the manifest file. Please correct and /// resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MissingParameterException"> /// One or more required parameters was missing from the request. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MultipleRegionsException"> /// Your manifest file contained buckets from multiple regions. A job is restricted to /// buckets from one region. Please correct and resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.NoSuchBucketException"> /// The specified bucket does not exist. Create the specified bucket or change the manifest's /// bucket, exportBucket, or logBucket field to a bucket that the account, as specified /// by the manifest's Access Key ID, has write permissions to. /// </exception> /// <exception cref="Amazon.ImportExport.Model.UnableToUpdateJobIdException"> /// AWS Import/Export cannot update the job /// </exception> public virtual UpdateJobResponse UpdateJob(UpdateJobRequest request) { var marshaller = UpdateJobRequestMarshaller.Instance; var unmarshaller = UpdateJobResponseUnmarshaller.Instance; return(Invoke <UpdateJobRequest, UpdateJobResponse>(request, marshaller, unmarshaller)); }
public async Task UpdateJobAsync2() { Mock <JobService.JobServiceClient> mockGrpcClient = new Mock <JobService.JobServiceClient>(MockBehavior.Strict); UpdateJobRequest request = new UpdateJobRequest { Job = new Job(), }; Job expectedResponse = new Job { JobNameOneof = JobNameOneof.From(new JobOldName("[PROJECT]", "[JOBS]")), Company = "company950484093", RequisitionId = "requisitionId980224926", Title = "title110371416", Description = "description-1724546052", Department = "department848184146", Incentives = "incentives-1262874520", LanguageCode = "languageCode-412800396", PromotionValue = 353413845, Qualifications = "qualifications1903501412", Responsibilities = "responsibilities-926952660", CompanyDisplayName = "companyDisplayName1982424170", }; mockGrpcClient.Setup(x => x.UpdateJobAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <Job>(Task.FromResult(expectedResponse), null, null, null, null)); JobServiceClient client = new JobServiceClientImpl(mockGrpcClient.Object, null); Job response = await client.UpdateJobAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// <para> You use this operation to change the parameters specified in /// the original manifest file by supplying a new manifest file. The /// manifest file attached to this request replaces the original manifest /// file. You can only use the operation after a CreateJob request but /// before the data transfer starts and you can only use it on jobs you /// own. </para> /// </summary> /// /// <param name="updateJobRequest">Container for the necessary parameters /// to execute the UpdateJob service method on AmazonImportExport.</param> /// /// <returns>The response from the UpdateJob service method, as returned /// by AmazonImportExport.</returns> /// /// <exception cref="MalformedManifestException"/> /// <exception cref="BucketPermissionException"/> /// <exception cref="InvalidAddressException"/> /// <exception cref="InvalidParameterException"/> /// <exception cref="UnableToUpdateJobIdException"/> /// <exception cref="MultipleRegionsException"/> /// <exception cref="MissingParameterException"/> /// <exception cref="InvalidFileSystemException"/> /// <exception cref="CanceledJobIdException"/> /// <exception cref="MissingCustomsException"/> /// <exception cref="NoSuchBucketException"/> /// <exception cref="ExpiredJobIdException"/> /// <exception cref="InvalidAccessKeyIdException"/> /// <exception cref="InvalidCustomsException"/> /// <exception cref="InvalidManifestFieldException"/> /// <exception cref="MissingManifestFieldException"/> /// <exception cref="InvalidJobIdException"/> public UpdateJobResponse UpdateJob(UpdateJobRequest updateJobRequest) { IRequest <UpdateJobRequest> request = new UpdateJobRequestMarshaller().Marshall(updateJobRequest); UpdateJobResponse response = Invoke <UpdateJobRequest, UpdateJobResponse> (request, this.signer, UpdateJobResponseUnmarshaller.GetInstance()); return(response); }
public async Task <bool> Handle(UpdateJobRequest message, IOutputPort <UpdateJobResponse> outputPort) { bool isOwner = await jobOwnerShipValidator.IsJobOwner(message.CallerUserId, message.Id); var loadedJob = await jobRepository.GetById(message.Id); if (loadedJob == null) { outputPort.Handle(new UpdateJobResponse(new[] { applicationErrorFactory.ResourceNotFound })); return(false); } if (!isOwner) { outputPort.Handle(new UpdateJobResponse(new[] { applicationErrorFactory.ResourceNotOwned })); return(false); } mapper.Map(message, loadedJob); await jobRepository.Update(loadedJob); outputPort.Handle(new UpdateJobResponse()); return(true); }
public UpdateJobResponse UpdateJob(UpdateJobRequest request) { return(new UpdateJobResponse { Success = jobManager.JobStore.UpdateJob(request.JobData.AsInternalJobData()), }); }
public void UpdateJob() { Mock <CloudScheduler.CloudSchedulerClient> mockGrpcClient = new Mock <CloudScheduler.CloudSchedulerClient>(MockBehavior.Strict); UpdateJobRequest expectedRequest = new UpdateJobRequest { Job = new Job(), UpdateMask = new FieldMask(), }; Job expectedResponse = new Job { JobName = new JobName("[PROJECT]", "[LOCATION]", "[JOB]"), Description = "description-1724546052", Schedule = "schedule-697920873", TimeZone = "timeZone36848094", }; mockGrpcClient.Setup(x => x.UpdateJob(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); CloudSchedulerClient client = new CloudSchedulerClientImpl(mockGrpcClient.Object, null); Job job = new Job(); FieldMask updateMask = new FieldMask(); Job response = client.UpdateJob(job, updateMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task UpdateJobAsync() { Mock <CloudScheduler.CloudSchedulerClient> mockGrpcClient = new Mock <CloudScheduler.CloudSchedulerClient>(MockBehavior.Strict); UpdateJobRequest expectedRequest = new UpdateJobRequest { Job = new Job(), UpdateMask = new FieldMask(), }; Job expectedResponse = new Job { Name = "name3373707", Description = "description-1724546052", Schedule = "schedule-697920873", TimeZone = "timeZone36848094", }; mockGrpcClient.Setup(x => x.UpdateJobAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <Job>(Task.FromResult(expectedResponse), null, null, null, null)); CloudSchedulerClient client = new CloudSchedulerClientImpl(mockGrpcClient.Object, null); Job job = new Job(); FieldMask updateMask = new FieldMask(); Job response = await client.UpdateJobAsync(job, updateMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task <IActionResult> UpdateJob([FromBody] UpdateJobRequest job) { job.Email = User.Identity.Name; await _jobBusinessLogic.UpdateJob(job); return(this.OkResult()); }
public void UpdateJob() { Mock <JobService.JobServiceClient> mockGrpcClient = new Mock <JobService.JobServiceClient>(MockBehavior.Strict); UpdateJobRequest expectedRequest = new UpdateJobRequest { Job = new Job(), }; Job expectedResponse = new Job { JobNameOneof = JobNameOneof.From(new JobName("[PROJECT]", "[TENANT]", "[JOBS]")), CompanyAsCompanyNameOneof = CompanyNameOneof.From(new CompanyName("[PROJECT]", "[TENANT]", "[COMPANY]")), RequisitionId = "requisitionId980224926", Title = "title110371416", Description = "description-1724546052", Department = "department848184146", Incentives = "incentives-1262874520", LanguageCode = "languageCode-412800396", PromotionValue = 353413845, Qualifications = "qualifications1903501412", Responsibilities = "responsibilities-926952660", CompanyDisplayName = "companyDisplayName1982424170", }; mockGrpcClient.Setup(x => x.UpdateJob(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); JobServiceClient client = new JobServiceClientImpl(mockGrpcClient.Object, null); Job job = new Job(); Job response = client.UpdateJob(job); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
internal UpdateJobResponse UpdateJob(UpdateJobRequest request) { var marshaller = new UpdateJobRequestMarshaller(); var unmarshaller = UpdateJobResponseUnmarshaller.Instance; return(Invoke <UpdateJobRequest, UpdateJobResponse>(request, marshaller, unmarshaller)); }
protected override void ProcessRecord() { base.ProcessRecord(); UpdateJobRequest request; try { request = new UpdateJobRequest { CatalogId = CatalogId, JobKey = JobKey, UpdateJobDetails = UpdateJobDetails, IfMatch = IfMatch, OpcRequestId = OpcRequestId }; response = client.UpdateJob(request).GetAwaiter().GetResult(); WriteOutput(response, response.Job); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/// <summary> /// Initiates the asynchronous execution of the UpdateJob operation. /// <seealso cref="Amazon.ImportExport.IAmazonImportExport.UpdateJob"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <UpdateJobResponse> UpdateJobAsync(UpdateJobRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateJobRequestMarshaller(); var unmarshaller = UpdateJobResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, UpdateJobRequest, UpdateJobResponse>(request, marshaller, unmarshaller, signer, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the UpdateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <UpdateJobResponse> UpdateJobAsync(UpdateJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateJobRequestMarshaller(); var unmarshaller = UpdateJobResponseUnmarshaller.Instance; return(InvokeAsync <UpdateJobRequest, UpdateJobResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the UpdateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob operation on AmazonSnowballClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateJob /// operation.</returns> public IAsyncResult BeginUpdateJob(UpdateJobRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateJobRequestMarshaller(); var unmarshaller = UpdateJobResponseUnmarshaller.Instance; return(BeginInvoke <UpdateJobRequest>(request, marshaller, unmarshaller, callback, state)); }
/// <summary> /// Initiates the asynchronous execution of the UpdateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public virtual Task <UpdateJobResponse> UpdateJobAsync(UpdateJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobResponseUnmarshaller.Instance; return(InvokeAsync <UpdateJobResponse>(request, options, cancellationToken)); }
/// <summary> /// You use this operation to change the parameters specified in the original manifest /// file by supplying a new manifest file. The manifest file attached to this request /// replaces the original manifest file. You can only use the operation after a CreateJob /// request but before the data transfer starts and you can only use it on jobs you own. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJob service method.</param> /// /// <returns>The response from the UpdateJob service method, as returned by ImportExport.</returns> /// <exception cref="Amazon.ImportExport.Model.BucketPermissionException"> /// The account specified does not have the appropriate bucket permissions. /// </exception> /// <exception cref="Amazon.ImportExport.Model.CanceledJobIdException"> /// The specified job ID has been canceled and is no longer valid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.ExpiredJobIdException"> /// Indicates that the specified job has expired out of the system. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidAccessKeyIdException"> /// The AWS Access Key ID specified in the request did not match the manifest's accessKeyId /// value. The manifest and the request authentication must use the same AWS Access Key /// ID. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidAddressException"> /// The address specified in the manifest is invalid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidCustomsException"> /// One or more customs parameters was invalid. Please correct and resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidFileSystemException"> /// File system specified in export manifest is invalid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidJobIdException"> /// The JOBID was missing, not found, or not associated with the AWS account. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidManifestFieldException"> /// One or more manifest fields was invalid. Please correct and resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidParameterException"> /// One or more parameters had an invalid value. /// </exception> /// <exception cref="Amazon.ImportExport.Model.InvalidVersionException"> /// The client tool version is invalid. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MalformedManifestException"> /// Your manifest is not well-formed. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MissingCustomsException"> /// One or more required customs parameters was missing from the manifest. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MissingManifestFieldException"> /// One or more required fields were missing from the manifest file. Please correct and /// resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MissingParameterException"> /// One or more required parameters was missing from the request. /// </exception> /// <exception cref="Amazon.ImportExport.Model.MultipleRegionsException"> /// Your manifest file contained buckets from multiple regions. A job is restricted to /// buckets from one region. Please correct and resubmit. /// </exception> /// <exception cref="Amazon.ImportExport.Model.NoSuchBucketException"> /// The specified bucket does not exist. Create the specified bucket or change the manifest's /// bucket, exportBucket, or logBucket field to a bucket that the account, as specified /// by the manifest's Access Key ID, has write permissions to. /// </exception> /// <exception cref="Amazon.ImportExport.Model.UnableToUpdateJobIdException"> /// AWS Import/Export cannot update the job /// </exception> public virtual UpdateJobResponse UpdateJob(UpdateJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobResponseUnmarshaller.Instance; return(Invoke <UpdateJobResponse>(request, options)); }
/// <summary> /// Initiates the asynchronous execution of the UpdateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob operation on AmazonImportExportClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateJob /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/importexport-2010-06-01/UpdateJob">REST API Reference for UpdateJob Operation</seealso> public virtual IAsyncResult BeginUpdateJob(UpdateJobRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobResponseUnmarshaller.Instance; return(BeginInvoke(request, options, callback, state)); }
IAsyncResult invokeUpdateJob(UpdateJobRequest updateJobRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new UpdateJobRequestMarshaller().Marshall(updateJobRequest); var unmarshaller = UpdateJobResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return(result); }
public async stt::Task UpdateJobRequestObjectAsync() { moq::Mock <JobController.JobControllerClient> mockGrpcClient = new moq::Mock <JobController.JobControllerClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object); UpdateJobRequest request = new UpdateJobRequest { ProjectId = "project_id43ad98b0", Region = "regionedb20d96", JobId = "job_id38ea97d6", Job = new Job(), UpdateMask = new wkt::FieldMask(), }; Job expectedResponse = new Job { Reference = new JobReference(), Placement = new JobPlacement(), HadoopJob = new HadoopJob(), SparkJob = new SparkJob(), PysparkJob = new PySparkJob(), HiveJob = new HiveJob(), PigJob = new PigJob(), Status = new JobStatus(), YarnApplications = { new YarnApplication(), }, SparkSqlJob = new SparkSqlJob(), StatusHistory = { new JobStatus(), }, DriverControlFilesUri = "driver_control_files_uribe41e88b", DriverOutputResourceUri = "driver_output_resource_urie2b470d7", Labels = { { "key8a0b6e3c", "value60c16320" }, }, Scheduling = new JobScheduling(), SparkRJob = new SparkRJob(), JobUuid = "job_uuid7530ffdd", PrestoJob = new PrestoJob(), Done = true, }; mockGrpcClient.Setup(x => x.UpdateJobAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Job>(stt::Task.FromResult(expectedResponse), null, null, null, null)); JobControllerClient client = new JobControllerClientImpl(mockGrpcClient.Object, null); Job responseCallSettings = await client.UpdateJobAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Job responseCancellationToken = await client.UpdateJobAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public IHttpActionResult Put( [FromUri] UpdateJobRequest request, [FromBody] Delta <WriteJobPayload> input) { request.OrganizationUserId = Credential.OrganizationUserId; request.Payload = input; var job = _updateJobRequestProcessor.Process(request); return(Ok(job)); }
// [END custom_attribute_filter_multi_attributes] public static Job UpdateJob(string jobName, Job toBeUpdated) { UpdateJobRequest updateJobRequest = new UpdateJobRequest() { Job = toBeUpdated }; Job jobUpdated = jobServiceClient.Projects.Jobs.Patch(updateJobRequest, jobName).Execute(); Console.WriteLine("Job updated: " + ToJsonString(jobUpdated)); return(jobUpdated); }
public static Job UpdateJobWithFieldMask(string jobName, string fieldMask, Job jobToBeUpdated) { UpdateJobRequest updateJobRequest = new UpdateJobRequest() { Job = jobToBeUpdated, UpdateMask = fieldMask }; Job jobUpdated = jobServiceClient.Projects.Jobs.Patch(updateJobRequest, jobName).Execute(); Console.WriteLine("Job updated with fieldMask: " + ToJsonString(jobUpdated)); return(jobUpdated); }
/// <summary>Snippet for UpdateJob</summary> public void UpdateJob_RequestObject() { // Snippet: UpdateJob(UpdateJobRequest,CallSettings) // Create client JobServiceClient jobServiceClient = JobServiceClient.Create(); // Initialize request argument(s) UpdateJobRequest request = new UpdateJobRequest { Job = new Job(), }; // Make the request Job response = jobServiceClient.UpdateJob(request); // End snippet }
/// <summary> /// <para> You use this operation to change the parameters specified in the original manifest file by supplying a new manifest file. The /// manifest file attached to this request replaces the original manifest file. You can only use the operation after a CreateJob request but /// before the data transfer starts and you can only use it on jobs you own. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob service method on AmazonImportExport.</param> /// /// <returns>The response from the UpdateJob service method, as returned by AmazonImportExport.</returns> /// /// <exception cref="T:Amazon.ImportExport.Model.MalformedManifestException" /> /// <exception cref="T:Amazon.ImportExport.Model.BucketPermissionException" /> /// <exception cref="T:Amazon.ImportExport.Model.InvalidAddressException" /> /// <exception cref="T:Amazon.ImportExport.Model.InvalidParameterException" /> /// <exception cref="T:Amazon.ImportExport.Model.MultipleRegionsException" /> /// <exception cref="T:Amazon.ImportExport.Model.MissingParameterException" /> /// <exception cref="T:Amazon.ImportExport.Model.InvalidFileSystemException" /> /// <exception cref="T:Amazon.ImportExport.Model.CanceledJobIdException" /> /// <exception cref="T:Amazon.ImportExport.Model.MissingCustomsException" /> /// <exception cref="T:Amazon.ImportExport.Model.NoSuchBucketException" /> /// <exception cref="T:Amazon.ImportExport.Model.ExpiredJobIdException" /> /// <exception cref="T:Amazon.ImportExport.Model.InvalidAccessKeyIdException" /> /// <exception cref="T:Amazon.ImportExport.Model.InvalidCustomsException" /> /// <exception cref="T:Amazon.ImportExport.Model.InvalidManifestFieldException" /> /// <exception cref="T:Amazon.ImportExport.Model.MissingManifestFieldException" /> /// <exception cref="T:Amazon.ImportExport.Model.InvalidJobIdException" /> public UpdateJobResponse UpdateJob(UpdateJobRequest request) { var task = UpdateJobAsync(request); try { return(task.Result); } catch (AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return(null); } }
public void UpdateJobRequestObject() { moq::Mock <JobController.JobControllerClient> mockGrpcClient = new moq::Mock <JobController.JobControllerClient>(moq::MockBehavior.Strict); UpdateJobRequest request = new UpdateJobRequest { ProjectId = "project_id43ad98b0", Region = "regionedb20d96", JobId = "job_id38ea97d6", Job = new Job(), UpdateMask = new wkt::FieldMask(), }; Job expectedResponse = new Job { Reference = new JobReference(), Placement = new JobPlacement(), HadoopJob = new HadoopJob(), SparkJob = new SparkJob(), PysparkJob = new PySparkJob(), HiveJob = new HiveJob(), PigJob = new PigJob(), Status = new JobStatus(), YarnApplications = { new YarnApplication(), }, SparkSqlJob = new SparkSqlJob(), StatusHistory = { new JobStatus(), }, DriverControlFilesUri = "driver_control_files_uribe41e88b", DriverOutputResourceUri = "driver_output_resource_urie2b470d7", Labels = { { "key8a0b6e3c", "value60c16320" }, }, Scheduling = new JobScheduling(), SparkRJob = new SparkRJob(), JobUuid = "job_uuid7530ffdd", PrestoJob = new PrestoJob(), }; mockGrpcClient.Setup(x => x.UpdateJob(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); JobControllerClient client = new JobControllerClientImpl(mockGrpcClient.Object, null); Job response = client.UpdateJob(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task UpdateJob(UpdateJobRequest job) { var filter = Builders <Company> .Filter.Where(x => x.Email == job.Email); var resultCompany = await _mongoDbRepository.Find <Company>(filter); var company = resultCompany.FirstOrDefault(); var jobModel = Mapper.Map <Job>(job); jobModel.StartDay = jobModel.StartDay.Date; jobModel.ExpirationDate = jobModel.ExpirationDate.Date; jobModel.CompanyId = company.Id; jobModel = changeStatusJob(jobModel); await _mongoDbRepository.Replace(jobModel); }
/// <summary> /// 更新任务 /// </summary> /// <param name="req"><see cref="UpdateJobRequest"/></param> /// <returns><see cref="UpdateJobResponse"/></returns> public UpdateJobResponse UpdateJobSync(UpdateJobRequest req) { JsonResponseModel <UpdateJobResponse> rsp = null; try { var strResp = this.InternalRequestSync(req, "UpdateJob"); rsp = JsonConvert.DeserializeObject <JsonResponseModel <UpdateJobResponse> >(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return(rsp.Response); }
/// <summary>Snippet for UpdateJob</summary> public void UpdateJob_RequestObject() { // Snippet: UpdateJob(UpdateJobRequest,CallSettings) // Create client CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create(); // Initialize request argument(s) UpdateJobRequest request = new UpdateJobRequest { Job = new Job(), UpdateMask = new FieldMask(), }; // Make the request Job response = cloudSchedulerClient.UpdateJob(request); // End snippet }
/// <summary>Snippet for UpdateJobAsync</summary> public async Task UpdateJobAsync_RequestObject() { // Snippet: UpdateJobAsync(UpdateJobRequest,CallSettings) // Additional: UpdateJobAsync(UpdateJobRequest,CancellationToken) // Create client JobServiceClient jobServiceClient = await JobServiceClient.CreateAsync(); // Initialize request argument(s) UpdateJobRequest request = new UpdateJobRequest { Job = new Job(), }; // Make the request Job response = await jobServiceClient.UpdateJobAsync(request); // End snippet }