Example #1
0
        /// <summary>Snippet for Insert</summary>
        public void InsertRequestObject()
        {
            // Snippet: Insert(InsertVpnGatewayRequest, CallSettings)
            // Create client
            VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
            // Initialize request argument(s)
            InsertVpnGatewayRequest request = new InsertVpnGatewayRequest
            {
                RequestId          = "",
                Region             = "",
                VpnGatewayResource = new VpnGateway(),
                Project            = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = vpnGatewaysClient.Insert(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 = vpnGatewaysClient.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
        }
Example #2
0
        /// <summary>Snippet for SetLabels</summary>
        public void SetLabels()
        {
            // Snippet: SetLabels(string, string, string, RegionSetLabelsRequest, CallSettings)
            // Create client
            VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
            // Initialize request argument(s)
            string project  = "";
            string region   = "";
            string resource = "";
            RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest();
            // Make the request
            lro::Operation <Operation, Operation> response = vpnGatewaysClient.SetLabels(project, region, resource, regionSetLabelsRequestResource);

            // 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 = vpnGatewaysClient.PollOnceSetLabels(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 AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     VpnGatewayAggregatedList response = vpnGatewaysClient.AggregatedList(project);
     // End snippet
 }
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, string, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project    = "";
     string region     = "";
     string vpnGateway = "";
     // Make the request
     Operation response = vpnGatewaysClient.Delete(project, region, vpnGateway);
     // End snippet
 }
Example #5
0
 /// <summary>Snippet for GetStatus</summary>
 public void GetStatus()
 {
     // Snippet: GetStatus(string, string, string, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project    = "";
     string region     = "";
     string vpnGateway = "";
     // Make the request
     VpnGatewaysGetStatusResponse response = vpnGatewaysClient.GetStatus(project, region, vpnGateway);
     // End snippet
 }
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, VpnGateway, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     string     project            = "";
     string     region             = "";
     VpnGateway vpnGatewayResource = new VpnGateway();
     // Make the request
     Operation response = vpnGatewaysClient.Insert(project, region, vpnGatewayResource);
     // End snippet
 }
Example #7
0
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListVpnGatewaysRequest, CallSettings)
            // Create client
            VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
            // Initialize request argument(s)
            ListVpnGatewaysRequest request = new ListVpnGatewaysRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <VpnGatewayList, VpnGateway> response = vpnGatewaysClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (VpnGateway 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 (VpnGatewayList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (VpnGateway 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 <VpnGateway> 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 (VpnGateway 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
        }
Example #8
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissions()
 {
     // Snippet: TestIamPermissions(string, string, string, TestPermissionsRequest, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
     // Make the request
     TestPermissionsResponse response = vpnGatewaysClient.TestIamPermissions(project, region, resource, testPermissionsRequestResource);
     // End snippet
 }
 /// <summary>Snippet for SetLabels</summary>
 public void SetLabels()
 {
     // Snippet: SetLabels(string, string, string, RegionSetLabelsRequest, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest();
     // Make the request
     Operation response = vpnGatewaysClient.SetLabels(project, region, resource, regionSetLabelsRequestResource);
     // End snippet
 }
Example #10
0
 /// <summary>Snippet for GetStatus</summary>
 public void GetStatusRequestObject()
 {
     // Snippet: GetStatus(GetStatusVpnGatewayRequest, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     GetStatusVpnGatewayRequest request = new GetStatusVpnGatewayRequest
     {
         Region     = "",
         Project    = "",
         VpnGateway = "",
     };
     // Make the request
     VpnGatewaysGetStatusResponse response = vpnGatewaysClient.GetStatus(request);
     // End snippet
 }
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteVpnGatewayRequest, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     DeleteVpnGatewayRequest request = new DeleteVpnGatewayRequest
     {
         RequestId  = "",
         Region     = "",
         Project    = "",
         VpnGateway = "",
     };
     // Make the request
     Operation response = vpnGatewaysClient.Delete(request);
     // End snippet
 }
Example #12
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissionsRequestObject()
 {
     // Snippet: TestIamPermissions(TestIamPermissionsVpnGatewayRequest, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     TestIamPermissionsVpnGatewayRequest request = new TestIamPermissionsVpnGatewayRequest
     {
         Region   = "",
         Resource = "",
         Project  = "",
         TestPermissionsRequestResource = new TestPermissionsRequest(),
     };
     // Make the request
     TestPermissionsResponse response = vpnGatewaysClient.TestIamPermissions(request);
     // End snippet
 }
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertVpnGatewayRequest, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     InsertVpnGatewayRequest request = new InsertVpnGatewayRequest
     {
         RequestId          = "",
         Region             = "",
         VpnGatewayResource = new VpnGateway(),
         Project            = "",
     };
     // Make the request
     Operation response = vpnGatewaysClient.Insert(request);
     // End snippet
 }
 /// <summary>Snippet for SetLabels</summary>
 public void SetLabelsRequestObject()
 {
     // Snippet: SetLabels(SetLabelsVpnGatewayRequest, CallSettings)
     // Create client
     VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
     // Initialize request argument(s)
     SetLabelsVpnGatewayRequest request = new SetLabelsVpnGatewayRequest
     {
         RequestId = "",
         Region    = "",
         Resource  = "",
         Project   = "",
         RegionSetLabelsRequestResource = new RegionSetLabelsRequest(),
     };
     // Make the request
     Operation response = vpnGatewaysClient.SetLabels(request);
     // End snippet
 }
Example #15
0
        /// <summary>Snippet for AggregatedList</summary>
        public void AggregatedList()
        {
            // Snippet: AggregatedList(string, string, int?, CallSettings)
            // Create client
            VpnGatewaysClient vpnGatewaysClient = VpnGatewaysClient.Create();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedEnumerable <VpnGatewayAggregatedList, KeyValuePair <string, VpnGatewaysScopedList> > response = vpnGatewaysClient.AggregatedList(project);

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