Search in sources :

Example 1 with JobTemplateName

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");
    }
}
Also used : TranscoderServiceClient(com.google.cloud.video.transcoder.v1.TranscoderServiceClient) JobTemplateName(com.google.cloud.video.transcoder.v1.JobTemplateName)

Example 2 with JobTemplateName

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());
    }
}
Also used : TranscoderServiceClient(com.google.cloud.video.transcoder.v1.TranscoderServiceClient) JobTemplateName(com.google.cloud.video.transcoder.v1.JobTemplateName) JobTemplate(com.google.cloud.video.transcoder.v1.JobTemplate)

Aggregations

JobTemplateName (com.google.cloud.video.transcoder.v1.JobTemplateName)2 TranscoderServiceClient (com.google.cloud.video.transcoder.v1.TranscoderServiceClient)2 JobTemplate (com.google.cloud.video.transcoder.v1.JobTemplate)1