use of com.google.cloud.video.livestream.v1.LivestreamServiceClient in project java-docs-samples by GoogleCloudPlatform.
the class DeleteInput method deleteInput.
public static void deleteInput(String projectId, String location, String inputId) throws InterruptedException, ExecutionException, TimeoutException, IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
var deleteInputRequest = DeleteInputRequest.newBuilder().setName(InputName.of(projectId, location, inputId).toString()).build();
livestreamServiceClient.deleteInputAsync(deleteInputRequest).get(1, TimeUnit.MINUTES);
System.out.println("Deleted input");
}
}
use of com.google.cloud.video.livestream.v1.LivestreamServiceClient in project java-docs-samples by GoogleCloudPlatform.
the class GetChannel method getChannel.
public static void getChannel(String projectId, String location, String channelId) throws IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
ChannelName name = ChannelName.of(projectId, location, channelId);
Channel response = livestreamServiceClient.getChannel(name);
System.out.println("Channel: " + response.getName());
}
}
use of com.google.cloud.video.livestream.v1.LivestreamServiceClient in project java-docs-samples by GoogleCloudPlatform.
the class ListChannels method listChannels.
public static void listChannels(String projectId, String location) throws IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
var listChannelsRequest = ListChannelsRequest.newBuilder().setParent(LocationName.of(projectId, location).toString()).build();
LivestreamServiceClient.ListChannelsPagedResponse response = livestreamServiceClient.listChannels(listChannelsRequest);
System.out.println("Channels:");
for (Channel channel : response.iterateAll()) {
System.out.println(channel.getName());
}
}
}
use of com.google.cloud.video.livestream.v1.LivestreamServiceClient in project java-docs-samples by GoogleCloudPlatform.
the class ListInputs method listInputs.
public static void listInputs(String projectId, String location) throws IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (LivestreamServiceClient livestreamServiceClient = LivestreamServiceClient.create()) {
var listInputsRequest = ListInputsRequest.newBuilder().setParent(LocationName.of(projectId, location).toString()).build();
LivestreamServiceClient.ListInputsPagedResponse response = livestreamServiceClient.listInputs(listInputsRequest);
System.out.println("Inputs:");
for (Input input : response.iterateAll()) {
System.out.println(input.getName());
}
}
}
Aggregations