/// <summary>Snippet for AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     TargetPoolAggregatedList response = targetPoolsClient.AggregatedList(project);
     // End snippet
 }
Exemple #2
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListTargetPoolsRequest, CallSettings)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            ListTargetPoolsRequest request = new ListTargetPoolsRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <TargetPoolList, TargetPool> response = targetPoolsClient.ListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((TargetPool 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((TargetPoolList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (TargetPool 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 <TargetPool> 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 (TargetPool 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 Get()
 {
     // Snippet: Get(string, string, string, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string project    = "";
     string region     = "";
     string targetPool = "";
     // Make the request
     TargetPool response = targetPoolsClient.Get(project, region, targetPool);
     // End snippet
 }
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, TargetPool, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string     project            = "";
     string     region             = "";
     TargetPool targetPoolResource = new TargetPool();
     // Make the request
     Operation response = targetPoolsClient.Insert(project, region, targetPoolResource);
     // End snippet
 }
Exemple #5
0
        /// <summary>Snippet for AggregatedList</summary>
        public void AggregatedListRequestObject()
        {
            // Snippet: AggregatedList(AggregatedListTargetPoolsRequest, CallSettings)
            // Create client
            TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
            // Initialize request argument(s)
            AggregatedListTargetPoolsRequest request = new AggregatedListTargetPoolsRequest
            {
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                IncludeAllScopes     = false,
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <TargetPoolAggregatedList, KeyValuePair <string, TargetPoolsScopedList> > response = targetPoolsClient.AggregatedList(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair <string, TargetPoolsScopedList> 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 (TargetPoolAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, TargetPoolsScopedList> 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, TargetPoolsScopedList> > 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, TargetPoolsScopedList> 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 SetBackup</summary>
 public void SetBackup()
 {
     // Snippet: SetBackup(string, string, string, TargetReference, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string          project    = "";
     string          region     = "";
     string          targetPool = "";
     TargetReference targetReferenceResource = new TargetReference();
     // Make the request
     Operation response = targetPoolsClient.SetBackup(project, region, targetPool, targetReferenceResource);
     // End snippet
 }
 /// <summary>Snippet for RemoveInstance</summary>
 public void RemoveInstance()
 {
     // Snippet: RemoveInstance(string, string, string, TargetPoolsRemoveInstanceRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string project    = "";
     string region     = "";
     string targetPool = "";
     TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest();
     // Make the request
     Operation response = targetPoolsClient.RemoveInstance(project, region, targetPool, targetPoolsRemoveInstanceRequestResource);
     // End snippet
 }
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListAsync()
        {
            // Snippet: AggregatedListAsync(string, CallSettings)
            // Additional: AggregatedListAsync(string, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            // Make the request
            TargetPoolAggregatedList response = await targetPoolsClient.AggregatedListAsync(project);

            // End snippet
        }
 /// <summary>Snippet for GetHealth</summary>
 public void GetHealth()
 {
     // Snippet: GetHealth(string, string, string, InstanceReference, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string            project    = "";
     string            region     = "";
     string            targetPool = "";
     InstanceReference instanceReferenceResource = new InstanceReference();
     // Make the request
     TargetPoolInstanceHealth response = targetPoolsClient.GetHealth(project, region, targetPool, instanceReferenceResource);
     // End snippet
 }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetAsync()
        {
            // Snippet: GetAsync(string, string, string, CallSettings)
            // Additional: GetAsync(string, string, string, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string project    = "";
            string region     = "";
            string targetPool = "";
            // Make the request
            TargetPool response = await targetPoolsClient.GetAsync(project, region, targetPool);

            // End snippet
        }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, string, TargetPool, CallSettings)
            // Additional: InsertAsync(string, string, TargetPool, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string     project            = "";
            string     region             = "";
            TargetPool targetPoolResource = new TargetPool();
            // Make the request
            Operation response = await targetPoolsClient.InsertAsync(project, region, targetPoolResource);

            // End snippet
        }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     GetTargetPoolRequest request = new GetTargetPoolRequest
     {
         TargetPool = "",
         Region     = "",
         Project    = "",
     };
     // Make the request
     TargetPool response = targetPoolsClient.Get(request);
     // End snippet
 }
        /// <summary>Snippet for GetHealthAsync</summary>
        public async Task GetHealthAsync()
        {
            // Snippet: GetHealthAsync(string, string, string, InstanceReference, CallSettings)
            // Additional: GetHealthAsync(string, string, string, InstanceReference, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string            project    = "";
            string            region     = "";
            string            targetPool = "";
            InstanceReference instanceReferenceResource = new InstanceReference();
            // Make the request
            TargetPoolInstanceHealth response = await targetPoolsClient.GetHealthAsync(project, region, targetPool, instanceReferenceResource);

            // End snippet
        }
 /// <summary>Snippet for GetHealth</summary>
 public void GetHealthRequestObject()
 {
     // Snippet: GetHealth(GetHealthTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest
     {
         TargetPool = "",
         Region     = "",
         Project    = "",
         InstanceReferenceResource = new InstanceReference(),
     };
     // Make the request
     TargetPoolInstanceHealth response = targetPoolsClient.GetHealth(request);
     // End snippet
 }
        /// <summary>Snippet for RemoveHealthCheckAsync</summary>
        public async Task RemoveHealthCheckAsync()
        {
            // Snippet: RemoveHealthCheckAsync(string, string, string, TargetPoolsRemoveHealthCheckRequest, CallSettings)
            // Additional: RemoveHealthCheckAsync(string, string, string, TargetPoolsRemoveHealthCheckRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string project    = "";
            string region     = "";
            string targetPool = "";
            TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest();
            // Make the request
            Operation response = await targetPoolsClient.RemoveHealthCheckAsync(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource);

            // End snippet
        }
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     DeleteTargetPoolRequest request = new DeleteTargetPoolRequest
     {
         RequestId  = "",
         TargetPool = "",
         Region     = "",
         Project    = "",
     };
     // Make the request
     Operation response = targetPoolsClient.Delete(request);
     // End snippet
 }
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     InsertTargetPoolRequest request = new InsertTargetPoolRequest
     {
         RequestId          = "",
         TargetPoolResource = new TargetPool(),
         Region             = "",
         Project            = "",
     };
     // Make the request
     Operation response = targetPoolsClient.Insert(request);
     // End snippet
 }
Exemple #18
0
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListAsync()
        {
            // Snippet: AggregatedListAsync(string, string, int?, CallSettings)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedAsyncEnumerable <TargetPoolAggregatedList, KeyValuePair <string, TargetPoolsScopedList> > response = targetPoolsClient.AggregatedListAsync(project);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((KeyValuePair <string, TargetPoolsScopedList> 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((TargetPoolAggregatedList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, TargetPoolsScopedList> 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, TargetPoolsScopedList> > 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 (KeyValuePair <string, TargetPoolsScopedList> 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 #19
0
        /// <summary>Snippet for List</summary>
        public void List()
        {
            // Snippet: List(string, string, string, int?, CallSettings)
            // Create client
            TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region  = "";
            // Make the request
            PagedEnumerable <TargetPoolList, TargetPool> response = targetPoolsClient.List(project, region);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (TargetPool 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 (TargetPoolList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (TargetPool 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 <TargetPool> 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 (TargetPool 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 AddHealthCheck</summary>
 public void AddHealthCheckRequestObject()
 {
     // Snippet: AddHealthCheck(AddHealthCheckTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     AddHealthCheckTargetPoolRequest request = new AddHealthCheckTargetPoolRequest
     {
         RequestId  = "",
         TargetPool = "",
         Region     = "",
         Project    = "",
         TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(),
     };
     // Make the request
     Operation response = targetPoolsClient.AddHealthCheck(request);
     // End snippet
 }
 /// <summary>Snippet for RemoveInstance</summary>
 public void RemoveInstanceRequestObject()
 {
     // Snippet: RemoveInstance(RemoveInstanceTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     RemoveInstanceTargetPoolRequest request = new RemoveInstanceTargetPoolRequest
     {
         TargetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(),
         RequestId  = "",
         TargetPool = "",
         Region     = "",
         Project    = "",
     };
     // Make the request
     Operation response = targetPoolsClient.RemoveInstance(request);
     // End snippet
 }
 /// <summary>Snippet for SetBackup</summary>
 public void SetBackupRequestObject()
 {
     // Snippet: SetBackup(SetBackupTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     SetBackupTargetPoolRequest request = new SetBackupTargetPoolRequest
     {
         RequestId               = "",
         TargetPool              = "",
         Region                  = "",
         FailoverRatio           = 0F,
         Project                 = "",
         TargetReferenceResource = new TargetReference(),
     };
     // Make the request
     Operation response = targetPoolsClient.SetBackup(request);
     // End snippet
 }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetTargetPoolRequest, CallSettings)
            // Additional: GetAsync(GetTargetPoolRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            GetTargetPoolRequest request = new GetTargetPoolRequest
            {
                TargetPool = "",
                Region     = "",
                Project    = "",
            };
            // Make the request
            TargetPool response = await targetPoolsClient.GetAsync(request);

            // End snippet
        }
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteTargetPoolRequest, CallSettings)
            // Additional: DeleteAsync(DeleteTargetPoolRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            DeleteTargetPoolRequest request = new DeleteTargetPoolRequest
            {
                RequestId  = "",
                TargetPool = "",
                Region     = "",
                Project    = "",
            };
            // Make the request
            Operation response = await targetPoolsClient.DeleteAsync(request);

            // End snippet
        }
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListTargetPoolsRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     ListTargetPoolsRequest request = new ListTargetPoolsRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Region               = "",
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     TargetPoolList response = targetPoolsClient.List(request);
     // End snippet
 }
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedListRequestObject()
 {
     // Snippet: AggregatedList(AggregatedListTargetPoolsRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     AggregatedListTargetPoolsRequest request = new AggregatedListTargetPoolsRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         IncludeAllScopes     = false,
         ReturnPartialSuccess = false,
     };
     // Make the request
     TargetPoolAggregatedList response = targetPoolsClient.AggregatedList(request);
     // End snippet
 }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertTargetPoolRequest, CallSettings)
            // Additional: InsertAsync(InsertTargetPoolRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            InsertTargetPoolRequest request = new InsertTargetPoolRequest
            {
                RequestId          = "",
                TargetPoolResource = new TargetPool(),
                Region             = "",
                Project            = "",
            };
            // Make the request
            Operation response = await targetPoolsClient.InsertAsync(request);

            // End snippet
        }
        /// <summary>Snippet for AddHealthCheckAsync</summary>
        public async Task AddHealthCheckRequestObjectAsync()
        {
            // Snippet: AddHealthCheckAsync(AddHealthCheckTargetPoolRequest, CallSettings)
            // Additional: AddHealthCheckAsync(AddHealthCheckTargetPoolRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            AddHealthCheckTargetPoolRequest request = new AddHealthCheckTargetPoolRequest
            {
                RequestId  = "",
                TargetPool = "",
                Region     = "",
                Project    = "",
                TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(),
            };
            // Make the request
            Operation response = await targetPoolsClient.AddHealthCheckAsync(request);

            // End snippet
        }
        /// <summary>Snippet for RemoveInstanceAsync</summary>
        public async Task RemoveInstanceRequestObjectAsync()
        {
            // Snippet: RemoveInstanceAsync(RemoveInstanceTargetPoolRequest, CallSettings)
            // Additional: RemoveInstanceAsync(RemoveInstanceTargetPoolRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            RemoveInstanceTargetPoolRequest request = new RemoveInstanceTargetPoolRequest
            {
                TargetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(),
                RequestId  = "",
                TargetPool = "",
                Region     = "",
                Project    = "",
            };
            // Make the request
            Operation response = await targetPoolsClient.RemoveInstanceAsync(request);

            // End snippet
        }
        /// <summary>Snippet for SetBackupAsync</summary>
        public async Task SetBackupRequestObjectAsync()
        {
            // Snippet: SetBackupAsync(SetBackupTargetPoolRequest, CallSettings)
            // Additional: SetBackupAsync(SetBackupTargetPoolRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            SetBackupTargetPoolRequest request = new SetBackupTargetPoolRequest
            {
                RequestId               = "",
                TargetPool              = "",
                Region                  = "",
                FailoverRatio           = 0F,
                Project                 = "",
                TargetReferenceResource = new TargetReference(),
            };
            // Make the request
            Operation response = await targetPoolsClient.SetBackupAsync(request);

            // End snippet
        }