@Generated(value="by gapic-generator-java") public class TranscoderServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Job job = Job.newBuilder().build();
Job response = transcoderServiceClient.createJob(parent, job);
}
Note: close() needs to be called on the TranscoderServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
| CreateJob | Creates a job in the specified region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| ListJobs | Lists jobs in the specified region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| GetJob | Returns the job data. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| DeleteJob | Deletes a job. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| CreateJobTemplate | Creates a job template in the specified region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| ListJobTemplates | Lists job templates in the specified region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| GetJobTemplate | Returns the job template data. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| DeleteJobTemplate | Deletes a job template. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of TranscoderServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TranscoderServiceSettings transcoderServiceSettings =
TranscoderServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TranscoderServiceClient transcoderServiceClient =
TranscoderServiceClient.create(transcoderServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TranscoderServiceSettings transcoderServiceSettings =
TranscoderServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
TranscoderServiceClient transcoderServiceClient =
TranscoderServiceClient.create(transcoderServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TranscoderServiceSettings transcoderServiceSettings =
TranscoderServiceSettings.newHttpJsonBuilder().build();
TranscoderServiceClient transcoderServiceClient =
TranscoderServiceClient.create(transcoderServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
TranscoderServiceClient.ListJobsFixedSizeCollection |
static class |
TranscoderServiceClient.ListJobsPage |
static class |
TranscoderServiceClient.ListJobsPagedResponse |
static class |
TranscoderServiceClient.ListJobTemplatesFixedSizeCollection |
static class |
TranscoderServiceClient.ListJobTemplatesPage |
static class |
TranscoderServiceClient.ListJobTemplatesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
TranscoderServiceClient(TranscoderServiceSettings settings)
Constructs an instance of TranscoderServiceClient, using the given settings.
|
protected |
TranscoderServiceClient(TranscoderServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static TranscoderServiceClient |
create()
Constructs an instance of TranscoderServiceClient with default settings.
|
static TranscoderServiceClient |
create(TranscoderServiceSettings settings)
Constructs an instance of TranscoderServiceClient, using the given settings.
|
static TranscoderServiceClient |
create(TranscoderServiceStub stub)
Constructs an instance of TranscoderServiceClient, using the given stub for making calls.
|
Job |
createJob(CreateJobRequest request)
Creates a job in the specified region.
|
Job |
createJob(LocationName parent,
Job job)
Creates a job in the specified region.
|
Job |
createJob(String parent,
Job job)
Creates a job in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<CreateJobRequest,Job> |
createJobCallable()
Creates a job in the specified region.
|
JobTemplate |
createJobTemplate(CreateJobTemplateRequest request)
Creates a job template in the specified region.
|
JobTemplate |
createJobTemplate(LocationName parent,
JobTemplate jobTemplate,
String jobTemplateId)
Creates a job template in the specified region.
|
JobTemplate |
createJobTemplate(String parent,
JobTemplate jobTemplate,
String jobTemplateId)
Creates a job template in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<CreateJobTemplateRequest,JobTemplate> |
createJobTemplateCallable()
Creates a job template in the specified region.
|
void |
deleteJob(DeleteJobRequest request)
Deletes a job.
|
void |
deleteJob(JobName name)
Deletes a job.
|
void |
deleteJob(String name)
Deletes a job.
|
com.google.api.gax.rpc.UnaryCallable<DeleteJobRequest,com.google.protobuf.Empty> |
deleteJobCallable()
Deletes a job.
|
void |
deleteJobTemplate(DeleteJobTemplateRequest request)
Deletes a job template.
|
void |
deleteJobTemplate(JobTemplateName name)
Deletes a job template.
|
void |
deleteJobTemplate(String name)
Deletes a job template.
|
com.google.api.gax.rpc.UnaryCallable<DeleteJobTemplateRequest,com.google.protobuf.Empty> |
deleteJobTemplateCallable()
Deletes a job template.
|
Job |
getJob(GetJobRequest request)
Returns the job data.
|
Job |
getJob(JobName name)
Returns the job data.
|
Job |
getJob(String name)
Returns the job data.
|
com.google.api.gax.rpc.UnaryCallable<GetJobRequest,Job> |
getJobCallable()
Returns the job data.
|
JobTemplate |
getJobTemplate(GetJobTemplateRequest request)
Returns the job template data.
|
JobTemplate |
getJobTemplate(JobTemplateName name)
Returns the job template data.
|
JobTemplate |
getJobTemplate(String name)
Returns the job template data.
|
com.google.api.gax.rpc.UnaryCallable<GetJobTemplateRequest,JobTemplate> |
getJobTemplateCallable()
Returns the job template data.
|
TranscoderServiceSettings |
getSettings() |
TranscoderServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
TranscoderServiceClient.ListJobsPagedResponse |
listJobs(ListJobsRequest request)
Lists jobs in the specified region.
|
TranscoderServiceClient.ListJobsPagedResponse |
listJobs(LocationName parent)
Lists jobs in the specified region.
|
TranscoderServiceClient.ListJobsPagedResponse |
listJobs(String parent)
Lists jobs in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListJobsRequest,ListJobsResponse> |
listJobsCallable()
Lists jobs in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListJobsRequest,TranscoderServiceClient.ListJobsPagedResponse> |
listJobsPagedCallable()
Lists jobs in the specified region.
|
TranscoderServiceClient.ListJobTemplatesPagedResponse |
listJobTemplates(ListJobTemplatesRequest request)
Lists job templates in the specified region.
|
TranscoderServiceClient.ListJobTemplatesPagedResponse |
listJobTemplates(LocationName parent)
Lists job templates in the specified region.
|
TranscoderServiceClient.ListJobTemplatesPagedResponse |
listJobTemplates(String parent)
Lists job templates in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListJobTemplatesRequest,ListJobTemplatesResponse> |
listJobTemplatesCallable()
Lists job templates in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListJobTemplatesRequest,TranscoderServiceClient.ListJobTemplatesPagedResponse> |
listJobTemplatesPagedCallable()
Lists job templates in the specified region.
|
void |
shutdown() |
void |
shutdownNow() |
protected TranscoderServiceClient(TranscoderServiceSettings settings) throws IOException
IOExceptionprotected TranscoderServiceClient(TranscoderServiceStub stub)
public static final TranscoderServiceClient create() throws IOException
IOExceptionpublic static final TranscoderServiceClient create(TranscoderServiceSettings settings) throws IOException
IOExceptionpublic static final TranscoderServiceClient create(TranscoderServiceStub stub)
public final TranscoderServiceSettings getSettings()
public TranscoderServiceStub getStub()
public final Job createJob(LocationName parent, Job job)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Job job = Job.newBuilder().build();
Job response = transcoderServiceClient.createJob(parent, job);
}
parent - Required. The parent location to create and process this job. Format:
`projects/{project}/locations/{location}`job - Required. Parameters for creating transcoding job.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Job createJob(String parent, Job job)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Job job = Job.newBuilder().build();
Job response = transcoderServiceClient.createJob(parent, job);
}
parent - Required. The parent location to create and process this job. Format:
`projects/{project}/locations/{location}`job - Required. Parameters for creating transcoding job.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Job createJob(CreateJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
CreateJobRequest request =
CreateJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setJob(Job.newBuilder().build())
.build();
Job response = transcoderServiceClient.createJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateJobRequest,Job> createJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
CreateJobRequest request =
CreateJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setJob(Job.newBuilder().build())
.build();
ApiFuture<Job> future = transcoderServiceClient.createJobCallable().futureCall(request);
// Do something.
Job response = future.get();
}
public final TranscoderServiceClient.ListJobsPagedResponse listJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Job element : transcoderServiceClient.listJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final TranscoderServiceClient.ListJobsPagedResponse listJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Job element : transcoderServiceClient.listJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final TranscoderServiceClient.ListJobsPagedResponse listJobs(ListJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
ListJobsRequest request =
ListJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Job element : transcoderServiceClient.listJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListJobsRequest,TranscoderServiceClient.ListJobsPagedResponse> listJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
ListJobsRequest request =
ListJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Job> future = transcoderServiceClient.listJobsPagedCallable().futureCall(request);
// Do something.
for (Job element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListJobsRequest,ListJobsResponse> listJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
ListJobsRequest request =
ListJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListJobsResponse response = transcoderServiceClient.listJobsCallable().call(request);
for (Job element : response.getJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Job getJob(JobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
Job response = transcoderServiceClient.getJob(name);
}
name - Required. The name of the job to retrieve. Format:
`projects/{project}/locations/{location}/jobs/{job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final Job getJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString();
Job response = transcoderServiceClient.getJob(name);
}
name - Required. The name of the job to retrieve. Format:
`projects/{project}/locations/{location}/jobs/{job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final Job getJob(GetJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
GetJobRequest request =
GetJobRequest.newBuilder()
.setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
.build();
Job response = transcoderServiceClient.getJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetJobRequest,Job> getJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
GetJobRequest request =
GetJobRequest.newBuilder()
.setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
.build();
ApiFuture<Job> future = transcoderServiceClient.getJobCallable().futureCall(request);
// Do something.
Job response = future.get();
}
public final void deleteJob(JobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
transcoderServiceClient.deleteJob(name);
}
name - Required. The name of the job to delete. Format:
`projects/{project}/locations/{location}/jobs/{job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString();
transcoderServiceClient.deleteJob(name);
}
name - Required. The name of the job to delete. Format:
`projects/{project}/locations/{location}/jobs/{job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteJob(DeleteJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
DeleteJobRequest request =
DeleteJobRequest.newBuilder()
.setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
.setAllowMissing(true)
.build();
transcoderServiceClient.deleteJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteJobRequest,com.google.protobuf.Empty> deleteJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
DeleteJobRequest request =
DeleteJobRequest.newBuilder()
.setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString())
.setAllowMissing(true)
.build();
ApiFuture<Empty> future = transcoderServiceClient.deleteJobCallable().futureCall(request);
// Do something.
future.get();
}
public final JobTemplate createJobTemplate(LocationName parent, JobTemplate jobTemplate, String jobTemplateId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
JobTemplate jobTemplate = JobTemplate.newBuilder().build();
String jobTemplateId = "jobTemplateId-597733678";
JobTemplate response =
transcoderServiceClient.createJobTemplate(parent, jobTemplate, jobTemplateId);
}
parent - Required. The parent location to create this job template. Format:
`projects/{project}/locations/{location}`jobTemplate - Required. Parameters for creating job template.jobTemplateId - Required. The ID to use for the job template, which will become the final
component of the job template's resource name.
This value should be 4-63 characters, and valid characters must match the regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobTemplate createJobTemplate(String parent, JobTemplate jobTemplate, String jobTemplateId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
JobTemplate jobTemplate = JobTemplate.newBuilder().build();
String jobTemplateId = "jobTemplateId-597733678";
JobTemplate response =
transcoderServiceClient.createJobTemplate(parent, jobTemplate, jobTemplateId);
}
parent - Required. The parent location to create this job template. Format:
`projects/{project}/locations/{location}`jobTemplate - Required. Parameters for creating job template.jobTemplateId - Required. The ID to use for the job template, which will become the final
component of the job template's resource name.
This value should be 4-63 characters, and valid characters must match the regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobTemplate createJobTemplate(CreateJobTemplateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
CreateJobTemplateRequest request =
CreateJobTemplateRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setJobTemplate(JobTemplate.newBuilder().build())
.setJobTemplateId("jobTemplateId-597733678")
.build();
JobTemplate response = transcoderServiceClient.createJobTemplate(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateJobTemplateRequest,JobTemplate> createJobTemplateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
CreateJobTemplateRequest request =
CreateJobTemplateRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setJobTemplate(JobTemplate.newBuilder().build())
.setJobTemplateId("jobTemplateId-597733678")
.build();
ApiFuture<JobTemplate> future =
transcoderServiceClient.createJobTemplateCallable().futureCall(request);
// Do something.
JobTemplate response = future.get();
}
public final TranscoderServiceClient.ListJobTemplatesPagedResponse listJobTemplates(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (JobTemplate element : transcoderServiceClient.listJobTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent location from which to retrieve the collection of job
templates. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final TranscoderServiceClient.ListJobTemplatesPagedResponse listJobTemplates(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (JobTemplate element : transcoderServiceClient.listJobTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent location from which to retrieve the collection of job
templates. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final TranscoderServiceClient.ListJobTemplatesPagedResponse listJobTemplates(ListJobTemplatesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
ListJobTemplatesRequest request =
ListJobTemplatesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (JobTemplate element : transcoderServiceClient.listJobTemplates(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListJobTemplatesRequest,TranscoderServiceClient.ListJobTemplatesPagedResponse> listJobTemplatesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
ListJobTemplatesRequest request =
ListJobTemplatesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<JobTemplate> future =
transcoderServiceClient.listJobTemplatesPagedCallable().futureCall(request);
// Do something.
for (JobTemplate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListJobTemplatesRequest,ListJobTemplatesResponse> listJobTemplatesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
ListJobTemplatesRequest request =
ListJobTemplatesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListJobTemplatesResponse response =
transcoderServiceClient.listJobTemplatesCallable().call(request);
for (JobTemplate element : response.getJobTemplatesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final JobTemplate getJobTemplate(JobTemplateName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
JobTemplateName name = JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]");
JobTemplate response = transcoderServiceClient.getJobTemplate(name);
}
name - Required. The name of the job template to retrieve. Format:
`projects/{project}/locations/{location}/jobTemplates/{job_template}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobTemplate getJobTemplate(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String name = JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]").toString();
JobTemplate response = transcoderServiceClient.getJobTemplate(name);
}
name - Required. The name of the job template to retrieve. Format:
`projects/{project}/locations/{location}/jobTemplates/{job_template}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobTemplate getJobTemplate(GetJobTemplateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
GetJobTemplateRequest request =
GetJobTemplateRequest.newBuilder()
.setName(JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]").toString())
.build();
JobTemplate response = transcoderServiceClient.getJobTemplate(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetJobTemplateRequest,JobTemplate> getJobTemplateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
GetJobTemplateRequest request =
GetJobTemplateRequest.newBuilder()
.setName(JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]").toString())
.build();
ApiFuture<JobTemplate> future =
transcoderServiceClient.getJobTemplateCallable().futureCall(request);
// Do something.
JobTemplate response = future.get();
}
public final void deleteJobTemplate(JobTemplateName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
JobTemplateName name = JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]");
transcoderServiceClient.deleteJobTemplate(name);
}
name - Required. The name of the job template to delete.
`projects/{project}/locations/{location}/jobTemplates/{job_template}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteJobTemplate(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
String name = JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]").toString();
transcoderServiceClient.deleteJobTemplate(name);
}
name - Required. The name of the job template to delete.
`projects/{project}/locations/{location}/jobTemplates/{job_template}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteJobTemplate(DeleteJobTemplateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
DeleteJobTemplateRequest request =
DeleteJobTemplateRequest.newBuilder()
.setName(JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]").toString())
.setAllowMissing(true)
.build();
transcoderServiceClient.deleteJobTemplate(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteJobTemplateRequest,com.google.protobuf.Empty> deleteJobTemplateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TranscoderServiceClient transcoderServiceClient = TranscoderServiceClient.create()) {
DeleteJobTemplateRequest request =
DeleteJobTemplateRequest.newBuilder()
.setName(JobTemplateName.of("[PROJECT]", "[LOCATION]", "[JOB_TEMPLATE]").toString())
.setAllowMissing(true)
.build();
ApiFuture<Empty> future =
transcoderServiceClient.deleteJobTemplateCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.