/// <summary>Snippet for GetIngressRule</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetIngressRuleRequestObject()
 {
     // Create client
     FirewallClient firewallClient = FirewallClient.Create();
     // Initialize request argument(s)
     GetIngressRuleRequest request = new GetIngressRuleRequest {
         Name = "",
     };
     // Make the request
     FirewallRule response = firewallClient.GetIngressRule(request);
 }
예제 #2
0
        /// <summary>Snippet for DeleteIngressRule</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteIngressRuleRequestObject()
        {
            // Create client
            FirewallClient firewallClient = FirewallClient.Create();
            // Initialize request argument(s)
            DeleteIngressRuleRequest request = new DeleteIngressRuleRequest {
                Name = "",
            };

            // Make the request
            firewallClient.DeleteIngressRule(request);
        }
 /// <summary>Snippet for BatchUpdateIngressRules</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void BatchUpdateIngressRulesRequestObject()
 {
     // Create client
     FirewallClient firewallClient = FirewallClient.Create();
     // Initialize request argument(s)
     BatchUpdateIngressRulesRequest request = new BatchUpdateIngressRulesRequest
     {
         Name         = "",
         IngressRules = { new FirewallRule(), },
     };
     // Make the request
     BatchUpdateIngressRulesResponse response = firewallClient.BatchUpdateIngressRules(request);
 }
예제 #4
0
 /// <summary>Snippet for CreateIngressRule</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void CreateIngressRuleRequestObject()
 {
     // Create client
     FirewallClient firewallClient = FirewallClient.Create();
     // Initialize request argument(s)
     CreateIngressRuleRequest request = new CreateIngressRuleRequest
     {
         Parent = "",
         Rule   = new FirewallRule(),
     };
     // Make the request
     FirewallRule response = firewallClient.CreateIngressRule(request);
 }
예제 #5
0
 /// <summary>Snippet for UpdateIngressRule</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void UpdateIngressRuleRequestObject()
 {
     // Create client
     FirewallClient firewallClient = FirewallClient.Create();
     // Initialize request argument(s)
     UpdateIngressRuleRequest request = new UpdateIngressRuleRequest
     {
         Name       = "",
         Rule       = new FirewallRule(),
         UpdateMask = new FieldMask(),
     };
     // Make the request
     FirewallRule response = firewallClient.UpdateIngressRule(request);
 }
예제 #6
0
        /// <summary>Snippet for ListIngressRules</summary>
        public void ListIngressRulesRequestObject()
        {
            // Snippet: ListIngressRules(ListIngressRulesRequest, CallSettings)
            // Create client
            FirewallClient firewallClient = FirewallClient.Create();
            // Initialize request argument(s)
            ListIngressRulesRequest request = new ListIngressRulesRequest
            {
                Parent          = "",
                MatchingAddress = "",
            };
            // Make the request
            PagedEnumerable <ListIngressRulesResponse, FirewallRule> response = firewallClient.ListIngressRules(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (FirewallRule item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListIngressRulesResponse page in response.AsRawResponses())
            {
                // 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 = response.ReadPage(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
        }