Search in sources :

Example 16 with LivestreamServiceClient

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

Example 17 with LivestreamServiceClient

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());
    }
}
Also used : ChannelName(com.google.cloud.video.livestream.v1.ChannelName) Channel(com.google.cloud.video.livestream.v1.Channel) LivestreamServiceClient(com.google.cloud.video.livestream.v1.LivestreamServiceClient)

Example 18 with LivestreamServiceClient

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());
        }
    }
}
Also used : Channel(com.google.cloud.video.livestream.v1.Channel) LivestreamServiceClient(com.google.cloud.video.livestream.v1.LivestreamServiceClient)

Example 19 with LivestreamServiceClient

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());
        }
    }
}
Also used : Input(com.google.cloud.video.livestream.v1.Input) LivestreamServiceClient(com.google.cloud.video.livestream.v1.LivestreamServiceClient)

Aggregations

LivestreamServiceClient (com.google.cloud.video.livestream.v1.LivestreamServiceClient)19 Channel (com.google.cloud.video.livestream.v1.Channel)6 Input (com.google.cloud.video.livestream.v1.Input)5 Event (com.google.cloud.video.livestream.v1.Event)4 ChannelName (com.google.cloud.video.livestream.v1.ChannelName)3 NotFoundException (com.google.api.gax.rpc.NotFoundException)2 AudioStream (com.google.cloud.video.livestream.v1.AudioStream)2 VideoStream (com.google.cloud.video.livestream.v1.VideoStream)2 IOException (java.io.IOException)2 ExecutionException (java.util.concurrent.ExecutionException)2 TimeoutException (java.util.concurrent.TimeoutException)2 EventName (com.google.cloud.video.livestream.v1.EventName)1 InputName (com.google.cloud.video.livestream.v1.InputName)1