Search in sources :

Example 6 with JobName

use of com.google.cloud.talent.v4.JobName in project java-docs-samples by GoogleCloudPlatform.

the class DeleteJob method deleteJob.

// Deletes a job.
public static void deleteJob(String projectId, String location, String jobId) throws IOException {
    // once, and can be reused for multiple requests.
    try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
        JobName jobName = JobName.newBuilder().setProject(projectId).setLocation(location).setJob(jobId).build();
        var deleteJobRequest = DeleteJobRequest.newBuilder().setName(jobName.toString()).build();
        // Send the delete job request and process the response.
        transcoderServiceClient.deleteJob(deleteJobRequest);
        System.out.println("Deleted job");
    }
}
Also used : TranscoderServiceClient(com.google.cloud.video.transcoder.v1.TranscoderServiceClient) JobName(com.google.cloud.video.transcoder.v1.JobName)

Example 7 with JobName

use of com.google.cloud.talent.v4.JobName in project java-docs-samples by GoogleCloudPlatform.

the class GetJob method getJob.

// Gets a job.
public static void getJob(String projectId, String location, String jobId) throws IOException {
    // once, and can be reused for multiple requests.
    try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
        JobName jobName = JobName.newBuilder().setProject(projectId).setLocation(location).setJob(jobId).build();
        var getJobRequest = GetJobRequest.newBuilder().setName(jobName.toString()).build();
        // Send the get job request and process the response.
        Job job = transcoderServiceClient.getJob(getJobRequest);
        System.out.println("Job: " + job.getName());
    }
}
Also used : TranscoderServiceClient(com.google.cloud.video.transcoder.v1.TranscoderServiceClient) JobName(com.google.cloud.video.transcoder.v1.JobName) Job(com.google.cloud.video.transcoder.v1.Job)

Example 8 with JobName

use of com.google.cloud.talent.v4.JobName in project java-docs-samples by GoogleCloudPlatform.

the class JobSearchDeleteJob method deleteJob.

// Delete Job.
public static void deleteJob(String projectId, String tenantId, String jobId) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
        JobName name = JobName.ofProjectTenantJobName(projectId, tenantId, jobId);
        DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name.toString()).build();
        jobServiceClient.deleteJob(request);
        System.out.println("Deleted job.");
    }
}
Also used : DeleteJobRequest(com.google.cloud.talent.v4beta1.DeleteJobRequest) JobName(com.google.cloud.talent.v4beta1.JobName) JobServiceClient(com.google.cloud.talent.v4beta1.JobServiceClient)

Example 9 with JobName

use of com.google.cloud.talent.v4.JobName in project java-talent by googleapis.

the class JobSearchDeleteJob method deleteJob.

// Delete Job.
public static void deleteJob(String projectId, String tenantId, String jobId) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
        JobName name = JobName.of(projectId, tenantId, jobId);
        DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name.toString()).build();
        jobServiceClient.deleteJob(request);
        System.out.println("Deleted job.");
    }
}
Also used : DeleteJobRequest(com.google.cloud.talent.v4.DeleteJobRequest) JobName(com.google.cloud.talent.v4.JobName) JobServiceClient(com.google.cloud.talent.v4.JobServiceClient)

Aggregations

JobName (com.google.cloud.talent.v4beta1.JobName)4 JobServiceClient (com.google.cloud.talent.v4beta1.JobServiceClient)4 JobName (com.google.cloud.video.transcoder.v1.JobName)3 TranscoderServiceClient (com.google.cloud.video.transcoder.v1.TranscoderServiceClient)3 JobName (com.google.cloud.talent.v4.JobName)2 JobServiceClient (com.google.cloud.talent.v4.JobServiceClient)2 DeleteJobRequest (com.google.cloud.talent.v4beta1.DeleteJobRequest)2 GetJobRequest (com.google.cloud.talent.v4beta1.GetJobRequest)2 Job (com.google.cloud.talent.v4beta1.Job)2 Job (com.google.cloud.video.transcoder.v1.Job)2 DeleteJobRequest (com.google.cloud.talent.v4.DeleteJobRequest)1 GetJobRequest (com.google.cloud.talent.v4.GetJobRequest)1 Job (com.google.cloud.talent.v4.Job)1