/// <summary>Snippet for Delete</summary>
        public void DeleteRequestObject()
        {
            // Snippet: Delete(DeleteTargetVpnGatewayRequest, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest
            {
                RequestId        = "",
                Region           = "",
                Project          = "",
                TargetVpnGateway = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = targetVpnGatewaysClient.Delete(request);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted();
            // 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 = targetVpnGatewaysClient.PollOnceDelete(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
        }
        /// <summary>Snippet for Insert</summary>
        public void Insert()
        {
            // Snippet: Insert(string, string, TargetVpnGateway, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            string           project = "";
            string           region  = "";
            TargetVpnGateway targetVpnGatewayResource = new TargetVpnGateway();
            // Make the request
            lro::Operation <Operation, Operation> response = targetVpnGatewaysClient.Insert(project, region, targetVpnGatewayResource);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted();
            // 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 = targetVpnGatewaysClient.PollOnceInsert(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 #3
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     TargetVpnGatewayAggregatedList response = targetVpnGatewaysClient.AggregatedList(project);
     // End snippet
 }
 /// <summary>Snippet for Get</summary>
 public void Get()
 {
     // Snippet: Get(string, string, string, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project          = "";
     string region           = "";
     string targetVpnGateway = "";
     // Make the request
     TargetVpnGateway response = targetVpnGatewaysClient.Get(project, region, targetVpnGateway);
     // End snippet
 }
Exemple #5
0
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, TargetVpnGateway, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     string           project = "";
     string           region  = "";
     TargetVpnGateway targetVpnGatewayResource = new TargetVpnGateway();
     // Make the request
     Operation response = targetVpnGatewaysClient.Insert(project, region, targetVpnGatewayResource);
     // End snippet
 }
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListTargetVpnGatewaysRequest, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            ListTargetVpnGatewaysRequest request = new ListTargetVpnGatewaysRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <TargetVpnGatewayList, TargetVpnGateway> response = targetVpnGatewaysClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (TargetVpnGateway 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 (TargetVpnGatewayList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (TargetVpnGateway 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 <TargetVpnGateway> 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 (TargetVpnGateway 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 Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetTargetVpnGatewayRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest
     {
         Region           = "",
         Project          = "",
         TargetVpnGateway = "",
     };
     // Make the request
     TargetVpnGateway response = targetVpnGatewaysClient.Get(request);
     // End snippet
 }
Exemple #8
0
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertTargetVpnGatewayRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest
     {
         TargetVpnGatewayResource = new TargetVpnGateway(),
         RequestId = "",
         Region    = "",
         Project   = "",
     };
     // Make the request
     Operation response = targetVpnGatewaysClient.Insert(request);
     // End snippet
 }
Exemple #9
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteTargetVpnGatewayRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest
     {
         RequestId        = "",
         Region           = "",
         Project          = "",
         TargetVpnGateway = "",
     };
     // Make the request
     Operation response = targetVpnGatewaysClient.Delete(request);
     // End snippet
 }
        /// <summary>Snippet for AggregatedList</summary>
        public void AggregatedList()
        {
            // Snippet: AggregatedList(string, string, int?, CallSettings)
            // Create client
            TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedEnumerable <TargetVpnGatewayAggregatedList, KeyValuePair <string, TargetVpnGatewaysScopedList> > response = targetVpnGatewaysClient.AggregatedList(project);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair <string, TargetVpnGatewaysScopedList> 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 (TargetVpnGatewayAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, TargetVpnGatewaysScopedList> 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 <KeyValuePair <string, TargetVpnGatewaysScopedList> > 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 (KeyValuePair <string, TargetVpnGatewaysScopedList> 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 #11
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListTargetVpnGatewaysRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     ListTargetVpnGatewaysRequest request = new ListTargetVpnGatewaysRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Region               = "",
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     TargetVpnGatewayList response = targetVpnGatewaysClient.List(request);
     // End snippet
 }
Exemple #12
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedListRequestObject()
 {
     // Snippet: AggregatedList(AggregatedListTargetVpnGatewaysRequest, CallSettings)
     // Create client
     TargetVpnGatewaysClient targetVpnGatewaysClient = TargetVpnGatewaysClient.Create();
     // Initialize request argument(s)
     AggregatedListTargetVpnGatewaysRequest request = new AggregatedListTargetVpnGatewaysRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         IncludeAllScopes     = false,
         ReturnPartialSuccess = false,
     };
     // Make the request
     TargetVpnGatewayAggregatedList response = targetVpnGatewaysClient.AggregatedList(request);
     // End snippet
 }