use of com.google.cloud.video.transcoder.v1.JobTemplateName in project java-docs-samples by GoogleCloudPlatform.
the class DeleteJobTemplate method deleteJobTemplate.
// Deletes a job template.
public static void deleteJobTemplate(String projectId, String location, String templateId) throws IOException {
// once, and can be reused for multiple requests.
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
JobTemplateName jobTemplateName = JobTemplateName.newBuilder().setProject(projectId).setLocation(location).setJobTemplate(templateId).build();
var deleteJobTemplateRequest = DeleteJobTemplateRequest.newBuilder().setName(jobTemplateName.toString()).build();
// Send the delete job template request and process the response.
transcoderServiceClient.deleteJobTemplate(deleteJobTemplateRequest);
System.out.println("Deleted job template");
}
}
use of com.google.cloud.video.transcoder.v1.JobTemplateName in project java-docs-samples by GoogleCloudPlatform.
the class GetJobTemplate method getJobTemplate.
// Gets a job template.
public static void getJobTemplate(String projectId, String location, String templateId) throws IOException {
// once, and can be reused for multiple requests.
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
JobTemplateName jobTemplateName = JobTemplateName.newBuilder().setProject(projectId).setLocation(location).setJobTemplate(templateId).build();
var getJobTemplateRequest = GetJobTemplateRequest.newBuilder().setName(jobTemplateName.toString()).build();
// Send the get job template request and process the response.
JobTemplate jobTemplate = transcoderServiceClient.getJobTemplate(getJobTemplateRequest);
System.out.println("Job template: " + jobTemplate.getName());
}
}
Aggregations