/// <summary>Snippet for AnnotateVideoAsync</summary>
        public async Task AnnotateVideoAsync_RequestObject()
        {
            // Snippet: AnnotateVideoAsync(AnnotateVideoRequest,CallSettings)
            // Create client
            VideoIntelligenceServiceClient videoIntelligenceServiceClient = await VideoIntelligenceServiceClient.CreateAsync();

            // Initialize request argument(s)
            AnnotateVideoRequest request = new AnnotateVideoRequest();
            // Make the request
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> response =
                await videoIntelligenceServiceClient.AnnotateVideoAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> completedResponse =
                await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            AnnotateVideoResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> retrievedResponse =
                await videoIntelligenceServiceClient.PollOnceAnnotateVideoAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnnotateVideoResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        public async Task AnnotateVideoAsync()
        {
            // Snippet: AnnotateVideoAsync(string,IEnumerable<Feature>,ByteString,VideoContext,string,string,CallSettings)
            // Additional: AnnotateVideoAsync(string,IEnumerable<Feature>,ByteString,VideoContext,string,string,CancellationToken)
            // Create client
            VideoIntelligenceServiceClient videoIntelligenceServiceClient = await VideoIntelligenceServiceClient.CreateAsync();

            // Initialize request argument(s)
            string inputUri = "";
            IEnumerable <Feature> features     = new List <Feature>();
            ByteString            inputContent = ByteString.CopyFromUtf8("");
            VideoContext          videoContext = new VideoContext();
            string outputUri  = "";
            string locationId = "";
            // Make the request
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> response =
                await videoIntelligenceServiceClient.AnnotateVideoAsync(inputUri, features, inputContent, videoContext, outputUri, locationId);

            // Poll until the returned long-running operation is complete
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> completedResponse =
                await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            AnnotateVideoResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> retrievedResponse =
                await videoIntelligenceServiceClient.PollOnceAnnotateVideoAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnnotateVideoResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for AnnotateVideoAsync</summary>
        public async Task AnnotateVideoAsync()
        {
            // Snippet: AnnotateVideoAsync(string,IEnumerable<Feature>,CallSettings)
            // Additional: AnnotateVideoAsync(string,IEnumerable<Feature>,CancellationToken)
            // Create client
            VideoIntelligenceServiceClient videoIntelligenceServiceClient = await VideoIntelligenceServiceClient.CreateAsync();

            // Initialize request argument(s)
            string inputUri = "gs://demomaker/cat.mp4";
            IEnumerable <Feature> features = new[]
            {
                Feature.LabelDetection,
            };
            // Make the request
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> response =
                await videoIntelligenceServiceClient.AnnotateVideoAsync(inputUri, features);

            // Poll until the returned long-running operation is complete
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> completedResponse =
                await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            AnnotateVideoResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> retrievedResponse =
                await videoIntelligenceServiceClient.PollOnceAnnotateVideoAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnnotateVideoResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Beispiel #4
0
        /// <summary>Snippet for AnnotateVideoAsync</summary>
        public async Task AnnotateVideoRequestObjectAsync()
        {
            // Snippet: AnnotateVideoAsync(AnnotateVideoRequest, CallSettings)
            // Additional: AnnotateVideoAsync(AnnotateVideoRequest, CancellationToken)
            // Create client
            VideoIntelligenceServiceClient videoIntelligenceServiceClient = await VideoIntelligenceServiceClient.CreateAsync();

            // Initialize request argument(s)
            AnnotateVideoRequest request = new AnnotateVideoRequest
            {
                InputUri = "",
                Features =
                {
                    Feature.Unspecified,
                },
                VideoContext = new VideoContext(),
                OutputUri    = "",
                LocationId   = "",
                InputContent = ByteString.Empty,
            };
            // Make the request
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> response = await videoIntelligenceServiceClient.AnnotateVideoAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            AnnotateVideoResponse result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AnnotateVideoResponse, AnnotateVideoProgress> retrievedResponse = await videoIntelligenceServiceClient.PollOnceAnnotateVideoAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnnotateVideoResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }