Example #1
0
        /// <summary>Snippet for Update</summary>
        public void UpdateRequestObject()
        {
            // Snippet: Update(UpdateAutoscalerRequest, CallSettings)
            // Create client
            AutoscalersClient autoscalersClient = AutoscalersClient.Create();
            // Initialize request argument(s)
            UpdateAutoscalerRequest request = new UpdateAutoscalerRequest
            {
                Zone               = "",
                RequestId          = "",
                AutoscalerResource = new Autoscaler(),
                Project            = "",
                Autoscaler         = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = autoscalersClient.Update(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 = autoscalersClient.PollOnceUpdate(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 Delete</summary>
        public void Delete()
        {
            // Snippet: Delete(string, string, string, CallSettings)
            // Create client
            AutoscalersClient autoscalersClient = AutoscalersClient.Create();
            // Initialize request argument(s)
            string project    = "";
            string zone       = "";
            string autoscaler = "";
            // Make the request
            lro::Operation <Operation, Operation> response = autoscalersClient.Delete(project, zone, autoscaler);

            // 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 = autoscalersClient.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
        }
Example #3
0
        /// <summary>Snippet for PatchAsync</summary>
        public async Task PatchAsync()
        {
            // Snippet: PatchAsync(string, string, Autoscaler, CallSettings)
            // Additional: PatchAsync(string, string, Autoscaler, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            string     project            = "";
            string     zone               = "";
            Autoscaler autoscalerResource = new Autoscaler();
            // Make the request
            lro::Operation <Operation, Operation> response = await autoscalersClient.PatchAsync(project, zone, autoscalerResource);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();

            // 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 = await autoscalersClient.PollOncePatchAsync(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 #4
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     AutoscalerAggregatedList response = autoscalersClient.AggregatedList(project);
     // End snippet
 }
Example #5
0
 /// <summary>Snippet for List</summary>
 public void List()
 {
     // Snippet: List(string, string, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     string project = "";
     string zone    = "";
     // Make the request
     AutoscalerList response = autoscalersClient.List(project, zone);
     // End snippet
 }
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListRequestObjectAsync()
        {
            // Snippet: AggregatedListAsync(AggregatedListAutoscalersRequest, CallSettings)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            AggregatedListAutoscalersRequest request = new AggregatedListAutoscalersRequest
            {
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                IncludeAllScopes     = false,
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <AutoscalerAggregatedList, KeyValuePair <string, AutoscalersScopedList> > response = autoscalersClient.AggregatedListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((KeyValuePair <string, AutoscalersScopedList> 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((AutoscalerAggregatedList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, AutoscalersScopedList> 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, AutoscalersScopedList> > 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, AutoscalersScopedList> 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 Update</summary>
 public void Update()
 {
     // Snippet: Update(string, string, Autoscaler, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     string     project            = "";
     string     zone               = "";
     Autoscaler autoscalerResource = new Autoscaler();
     // Make the request
     Operation response = autoscalersClient.Update(project, zone, autoscalerResource);
     // End snippet
 }
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, string, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     string project    = "";
     string zone       = "";
     string autoscaler = "";
     // Make the request
     Operation response = autoscalersClient.Delete(project, zone, autoscaler);
     // End snippet
 }
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListAutoscalersRequest, CallSettings)
            // Create client
            AutoscalersClient autoscalersClient = AutoscalersClient.Create();
            // Initialize request argument(s)
            ListAutoscalersRequest request = new ListAutoscalersRequest
            {
                Zone    = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <AutoscalerList, Autoscaler> response = autoscalersClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Autoscaler 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 (AutoscalerList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Autoscaler 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 <Autoscaler> 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 (Autoscaler 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 #10
0
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListAsync()
        {
            // Snippet: AggregatedListAsync(string, CallSettings)
            // Additional: AggregatedListAsync(string, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

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

            // End snippet
        }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetAutoscalerRequest, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     GetAutoscalerRequest request = new GetAutoscalerRequest
     {
         Zone       = "",
         Project    = "",
         Autoscaler = "",
     };
     // Make the request
     Autoscaler response = autoscalersClient.Get(request);
     // 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
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            string project    = "";
            string zone       = "";
            string autoscaler = "";
            // Make the request
            Autoscaler response = await autoscalersClient.GetAsync(project, zone, autoscaler);

            // End snippet
        }
        /// <summary>Snippet for UpdateAsync</summary>
        public async Task UpdateAsync()
        {
            // Snippet: UpdateAsync(string, string, Autoscaler, CallSettings)
            // Additional: UpdateAsync(string, string, Autoscaler, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            string     project            = "";
            string     zone               = "";
            Autoscaler autoscalerResource = new Autoscaler();
            // Make the request
            Operation response = await autoscalersClient.UpdateAsync(project, zone, autoscalerResource);

            // End snippet
        }
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteAutoscalerRequest, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     DeleteAutoscalerRequest request = new DeleteAutoscalerRequest
     {
         Zone       = "",
         RequestId  = "",
         Project    = "",
         Autoscaler = "",
     };
     // Make the request
     Operation response = autoscalersClient.Delete(request);
     // End snippet
 }
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, string, string, int?, CallSettings)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            string zone    = "";
            // Make the request
            PagedAsyncEnumerable <AutoscalerList, Autoscaler> response = autoscalersClient.ListAsync(project, zone);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Autoscaler 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((AutoscalerList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Autoscaler 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 <Autoscaler> 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 (Autoscaler 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 Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertAutoscalerRequest, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     InsertAutoscalerRequest request = new InsertAutoscalerRequest
     {
         Zone               = "",
         RequestId          = "",
         AutoscalerResource = new Autoscaler(),
         Project            = "",
     };
     // Make the request
     Operation response = autoscalersClient.Insert(request);
     // End snippet
 }
        /// <summary>Snippet for AggregatedList</summary>
        public void AggregatedList()
        {
            // Snippet: AggregatedList(string, string, int?, CallSettings)
            // Create client
            AutoscalersClient autoscalersClient = AutoscalersClient.Create();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedEnumerable <AutoscalerAggregatedList, KeyValuePair <string, AutoscalersScopedList> > response = autoscalersClient.AggregatedList(project);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair <string, AutoscalersScopedList> 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 (AutoscalerAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, AutoscalersScopedList> 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, AutoscalersScopedList> > 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, AutoscalersScopedList> 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 GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetAutoscalerRequest, CallSettings)
            // Additional: GetAsync(GetAutoscalerRequest, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            GetAutoscalerRequest request = new GetAutoscalerRequest
            {
                Zone       = "",
                Project    = "",
                Autoscaler = "",
            };
            // Make the request
            Autoscaler response = await autoscalersClient.GetAsync(request);

            // End snippet
        }
Example #19
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedListRequestObject()
 {
     // Snippet: AggregatedList(AggregatedListAutoscalersRequest, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     AggregatedListAutoscalersRequest request = new AggregatedListAutoscalersRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Filter               = "",
         IncludeAllScopes     = false,
         OrderBy              = "",
         Project              = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     AutoscalerAggregatedList response = autoscalersClient.AggregatedList(request);
     // End snippet
 }
Example #20
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListAutoscalersRequest, CallSettings)
     // Create client
     AutoscalersClient autoscalersClient = AutoscalersClient.Create();
     // Initialize request argument(s)
     ListAutoscalersRequest request = new ListAutoscalersRequest
     {
         Zone                 = "",
         PageToken            = "",
         MaxResults           = 0U,
         Filter               = "",
         OrderBy              = "",
         Project              = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     AutoscalerList response = autoscalersClient.List(request);
     // End snippet
 }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertAutoscalerRequest, CallSettings)
            // Additional: InsertAsync(InsertAutoscalerRequest, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            InsertAutoscalerRequest request = new InsertAutoscalerRequest
            {
                Zone               = "",
                RequestId          = "",
                AutoscalerResource = new Autoscaler(),
                Project            = "",
            };
            // Make the request
            Operation response = await autoscalersClient.InsertAsync(request);

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

            // Initialize request argument(s)
            DeleteAutoscalerRequest request = new DeleteAutoscalerRequest
            {
                Zone       = "",
                RequestId  = "",
                Project    = "",
                Autoscaler = "",
            };
            // Make the request
            Operation response = await autoscalersClient.DeleteAsync(request);

            // End snippet
        }
Example #23
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListAutoscalersRequest, CallSettings)
            // Additional: ListAsync(ListAutoscalersRequest, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            ListAutoscalersRequest request = new ListAutoscalersRequest
            {
                Zone                 = "",
                PageToken            = "",
                MaxResults           = 0U,
                Filter               = "",
                OrderBy              = "",
                Project              = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            AutoscalerList response = await autoscalersClient.ListAsync(request);

            // End snippet
        }
Example #24
0
        /// <summary>Snippet for AggregatedListAsync</summary>
        public async Task AggregatedListRequestObjectAsync()
        {
            // Snippet: AggregatedListAsync(AggregatedListAutoscalersRequest, CallSettings)
            // Additional: AggregatedListAsync(AggregatedListAutoscalersRequest, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            AggregatedListAutoscalersRequest request = new AggregatedListAutoscalersRequest
            {
                PageToken            = "",
                MaxResults           = 0U,
                Filter               = "",
                IncludeAllScopes     = false,
                OrderBy              = "",
                Project              = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            AutoscalerAggregatedList response = await autoscalersClient.AggregatedListAsync(request);

            // End snippet
        }
Example #25
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteAutoscalerRequest, CallSettings)
            // Additional: DeleteAsync(DeleteAutoscalerRequest, CancellationToken)
            // Create client
            AutoscalersClient autoscalersClient = await AutoscalersClient.CreateAsync();

            // Initialize request argument(s)
            DeleteAutoscalerRequest request = new DeleteAutoscalerRequest
            {
                Zone       = "",
                RequestId  = "",
                Project    = "",
                Autoscaler = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await autoscalersClient.DeleteAsync(request);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();

            // 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 = await autoscalersClient.PollOnceDeleteAsync(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
        }