Exemple #1
0
        /// <summary>Snippet for PatchAsync</summary>
        public async Task PatchAsync()
        {
            // Snippet: PatchAsync(string, string, TargetGrpcProxy, CallSettings)
            // Additional: PatchAsync(string, string, TargetGrpcProxy, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            string          project                 = "";
            string          targetGrpcProxy         = "";
            TargetGrpcProxy targetGrpcProxyResource = new TargetGrpcProxy();
            // Make the request
            lro::Operation <Operation, Operation> response = await targetGrpcProxiesClient.PatchAsync(project, targetGrpcProxy, targetGrpcProxyResource);

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

            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = await targetGrpcProxiesClient.PollOncePatchAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Exemple #2
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListTargetGrpcProxiesRequest, CallSettings)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            ListTargetGrpcProxiesRequest request = new ListTargetGrpcProxiesRequest
            {
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <TargetGrpcProxyList, TargetGrpcProxy> response = targetGrpcProxiesClient.ListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((TargetGrpcProxy item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((TargetGrpcProxyList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (TargetGrpcProxy item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <TargetGrpcProxy> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (TargetGrpcProxy item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Exemple #3
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, CallSettings)
            // Additional: ListAsync(string, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            // Make the request
            TargetGrpcProxyList response = await targetGrpcProxiesClient.ListAsync(project);

            // End snippet
        }
Exemple #4
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteAsync()
        {
            // Snippet: DeleteAsync(string, string, CallSettings)
            // Additional: DeleteAsync(string, string, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            string project         = "";
            string targetGrpcProxy = "";
            // Make the request
            Operation response = await targetGrpcProxiesClient.DeleteAsync(project, targetGrpcProxy);

            // End snippet
        }
Exemple #5
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, TargetGrpcProxy, CallSettings)
            // Additional: InsertAsync(string, TargetGrpcProxy, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            string          project = "";
            TargetGrpcProxy targetGrpcProxyResource = new TargetGrpcProxy();
            // Make the request
            Operation response = await targetGrpcProxiesClient.InsertAsync(project, targetGrpcProxyResource);

            // End snippet
        }
Exemple #6
0
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetTargetGrpcProxyRequest, CallSettings)
            // Additional: GetAsync(GetTargetGrpcProxyRequest, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest
            {
                TargetGrpcProxy = "",
                Project         = "",
            };
            // Make the request
            TargetGrpcProxy response = await targetGrpcProxiesClient.GetAsync(request);

            // End snippet
        }
Exemple #7
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteTargetGrpcProxyRequest, CallSettings)
            // Additional: DeleteAsync(DeleteTargetGrpcProxyRequest, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            DeleteTargetGrpcProxyRequest request = new DeleteTargetGrpcProxyRequest
            {
                TargetGrpcProxy = "",
                RequestId       = "",
                Project         = "",
            };
            // Make the request
            Operation response = await targetGrpcProxiesClient.DeleteAsync(request);

            // End snippet
        }
Exemple #8
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertTargetGrpcProxyRequest, CallSettings)
            // Additional: InsertAsync(InsertTargetGrpcProxyRequest, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            InsertTargetGrpcProxyRequest request = new InsertTargetGrpcProxyRequest
            {
                RequestId = "",
                TargetGrpcProxyResource = new TargetGrpcProxy(),
                Project = "",
            };
            // Make the request
            Operation response = await targetGrpcProxiesClient.InsertAsync(request);

            // End snippet
        }
Exemple #9
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListTargetGrpcProxiesRequest, CallSettings)
            // Additional: ListAsync(ListTargetGrpcProxiesRequest, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            ListTargetGrpcProxiesRequest request = new ListTargetGrpcProxiesRequest
            {
                PageToken            = "",
                MaxResults           = 0U,
                Filter               = "",
                OrderBy              = "",
                Project              = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            TargetGrpcProxyList response = await targetGrpcProxiesClient.ListAsync(request);

            // End snippet
        }
Exemple #10
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteTargetGrpcProxyRequest, CallSettings)
            // Additional: DeleteAsync(DeleteTargetGrpcProxyRequest, CancellationToken)
            // Create client
            TargetGrpcProxiesClient targetGrpcProxiesClient = await TargetGrpcProxiesClient.CreateAsync();

            // Initialize request argument(s)
            DeleteTargetGrpcProxyRequest request = new DeleteTargetGrpcProxyRequest
            {
                TargetGrpcProxy = "",
                RequestId       = "",
                Project         = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await targetGrpcProxiesClient.DeleteAsync(request);

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

            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = await targetGrpcProxiesClient.PollOnceDeleteAsync(operationName);

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