/// <summary>Snippet for GetIngressRuleAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetIngressRuleRequestObjectAsync()
        {
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            GetIngressRuleRequest request = new GetIngressRuleRequest {
                Name = "",
            };
            // Make the request
            FirewallRule response = await firewallClient.GetIngressRuleAsync(request);
        }
        /// <summary>Snippet for BatchUpdateIngressRulesAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task BatchUpdateIngressRulesRequestObjectAsync()
        {
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            BatchUpdateIngressRulesRequest request = new BatchUpdateIngressRulesRequest
            {
                Name         = "",
                IngressRules = { new FirewallRule(), },
            };
            // Make the request
            BatchUpdateIngressRulesResponse response = await firewallClient.BatchUpdateIngressRulesAsync(request);
        }
Пример #3
0
        /// <summary>Snippet for CreateIngressRuleAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task CreateIngressRuleRequestObjectAsync()
        {
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            CreateIngressRuleRequest request = new CreateIngressRuleRequest
            {
                Parent = "",
                Rule   = new FirewallRule(),
            };
            // Make the request
            FirewallRule response = await firewallClient.CreateIngressRuleAsync(request);
        }
Пример #4
0
        /// <summary>Snippet for ListIngressRulesAsync</summary>
        public async Task ListIngressRulesRequestObjectAsync()
        {
            // Snippet: ListIngressRulesAsync(ListIngressRulesRequest, CallSettings)
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            ListIngressRulesRequest request = new ListIngressRulesRequest
            {
                Parent          = "",
                MatchingAddress = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListIngressRulesResponse, FirewallRule> response = firewallClient.ListIngressRulesAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((FirewallRule 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((ListIngressRulesResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (FirewallRule 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 <FirewallRule> 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 (FirewallRule 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
        }
        /// <summary>Snippet for UpdateIngressRuleAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task UpdateIngressRuleRequestObjectAsync()
        {
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            UpdateIngressRuleRequest request = new UpdateIngressRuleRequest
            {
                Name       = "",
                Rule       = new FirewallRule(),
                UpdateMask = new FieldMask(),
            };
            // Make the request
            FirewallRule response = await firewallClient.UpdateIngressRuleAsync(request);
        }
Пример #6
0
        /// <summary>Snippet for DeleteIngressRuleAsync</summary>
        public async Task DeleteIngressRuleRequestObjectAsync()
        {
            // Snippet: DeleteIngressRuleAsync(DeleteIngressRuleRequest, CallSettings)
            // Additional: DeleteIngressRuleAsync(DeleteIngressRuleRequest, CancellationToken)
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            DeleteIngressRuleRequest request = new DeleteIngressRuleRequest {
                Name = "",
            };
            // Make the request
            await firewallClient.DeleteIngressRuleAsync(request);

            // End snippet
        }
Пример #7
0
        /// <summary>Snippet for CreateIngressRuleAsync</summary>
        public async Task CreateIngressRuleRequestObjectAsync()
        {
            // Snippet: CreateIngressRuleAsync(CreateIngressRuleRequest, CallSettings)
            // Additional: CreateIngressRuleAsync(CreateIngressRuleRequest, CancellationToken)
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            CreateIngressRuleRequest request = new CreateIngressRuleRequest
            {
                Parent = "",
                Rule   = new FirewallRule(),
            };
            // Make the request
            FirewallRule response = await firewallClient.CreateIngressRuleAsync(request);

            // End snippet
        }
Пример #8
0
        /// <summary>Snippet for BatchUpdateIngressRulesAsync</summary>
        public async Task BatchUpdateIngressRulesRequestObjectAsync()
        {
            // Snippet: BatchUpdateIngressRulesAsync(BatchUpdateIngressRulesRequest, CallSettings)
            // Additional: BatchUpdateIngressRulesAsync(BatchUpdateIngressRulesRequest, CancellationToken)
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            BatchUpdateIngressRulesRequest request = new BatchUpdateIngressRulesRequest
            {
                Name         = "",
                IngressRules = { new FirewallRule(), },
            };
            // Make the request
            BatchUpdateIngressRulesResponse response = await firewallClient.BatchUpdateIngressRulesAsync(request);

            // End snippet
        }
Пример #9
0
        /// <summary>Snippet for UpdateIngressRuleAsync</summary>
        public async Task UpdateIngressRuleRequestObjectAsync()
        {
            // Snippet: UpdateIngressRuleAsync(UpdateIngressRuleRequest, CallSettings)
            // Additional: UpdateIngressRuleAsync(UpdateIngressRuleRequest, CancellationToken)
            // Create client
            FirewallClient firewallClient = await FirewallClient.CreateAsync();

            // Initialize request argument(s)
            UpdateIngressRuleRequest request = new UpdateIngressRuleRequest
            {
                Name       = "",
                Rule       = new FirewallRule(),
                UpdateMask = new FieldMask(),
            };
            // Make the request
            FirewallRule response = await firewallClient.UpdateIngressRuleAsync(request);

            // End snippet
        }