From bd045c25cf27af028cec0d53b4c8edb9b421d52a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 27 Mar 2020 22:40:59 -0700 Subject: [PATCH] Regenerate Google.Cloud.Dataproc.V1 (#4674) Adds resource name overloads for autoscaling policy operations --- ...utoscalingPolicyServiceClientSnippets.g.cs | 492 ++++++++++++ .../AutoscalingPolicyServiceClientTest.g.cs | 356 +++++++++ .../AutoscalingPolicies.cs | 77 +- .../AutoscalingPolicyServiceClient.g.cs | 748 ++++++++++++++++++ 4 files changed, 1635 insertions(+), 38 deletions(-) diff --git a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Snippets/AutoscalingPolicyServiceClientSnippets.g.cs b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Snippets/AutoscalingPolicyServiceClientSnippets.g.cs index c67cffcb0c61..a380a40b6ad0 100644 --- a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Snippets/AutoscalingPolicyServiceClientSnippets.g.cs +++ b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Snippets/AutoscalingPolicyServiceClientSnippets.g.cs @@ -60,6 +60,93 @@ public async Task CreateAutoscalingPolicyRequestObjectAsync() // End snippet } + /// Snippet for CreateAutoscalingPolicy + public void CreateAutoscalingPolicy() + { + // Snippet: CreateAutoscalingPolicy(string, AutoscalingPolicy, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + string parent = "projects/[PROJECT]/locations/[LOCATION]"; + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(parent, policy); + // End snippet + } + + /// Snippet for CreateAutoscalingPolicyAsync + public async Task CreateAutoscalingPolicyAsync() + { + // Snippet: CreateAutoscalingPolicyAsync(string, AutoscalingPolicy, CallSettings) + // Additional: CreateAutoscalingPolicyAsync(string, AutoscalingPolicy, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + string parent = "projects/[PROJECT]/locations/[LOCATION]"; + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy); + // End snippet + } + + /// Snippet for CreateAutoscalingPolicy + public void CreateAutoscalingPolicyResourceNames1() + { + // Snippet: CreateAutoscalingPolicy(LocationName, AutoscalingPolicy, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(parent, policy); + // End snippet + } + + /// Snippet for CreateAutoscalingPolicyAsync + public async Task CreateAutoscalingPolicyResourceNames1Async() + { + // Snippet: CreateAutoscalingPolicyAsync(LocationName, AutoscalingPolicy, CallSettings) + // Additional: CreateAutoscalingPolicyAsync(LocationName, AutoscalingPolicy, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy); + // End snippet + } + + /// Snippet for CreateAutoscalingPolicy + public void CreateAutoscalingPolicyResourceNames2() + { + // Snippet: CreateAutoscalingPolicy(RegionName, AutoscalingPolicy, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]"); + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(parent, policy); + // End snippet + } + + /// Snippet for CreateAutoscalingPolicyAsync + public async Task CreateAutoscalingPolicyResourceNames2Async() + { + // Snippet: CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CallSettings) + // Additional: CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]"); + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy); + // End snippet + } + /// Snippet for UpdateAutoscalingPolicy public void UpdateAutoscalingPolicyRequestObject() { @@ -93,6 +180,33 @@ public async Task UpdateAutoscalingPolicyRequestObjectAsync() // End snippet } + /// Snippet for UpdateAutoscalingPolicy + public void UpdateAutoscalingPolicy() + { + // Snippet: UpdateAutoscalingPolicy(AutoscalingPolicy, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = autoscalingPolicyServiceClient.UpdateAutoscalingPolicy(policy); + // End snippet + } + + /// Snippet for UpdateAutoscalingPolicyAsync + public async Task UpdateAutoscalingPolicyAsync() + { + // Snippet: UpdateAutoscalingPolicyAsync(AutoscalingPolicy, CallSettings) + // Additional: UpdateAutoscalingPolicyAsync(AutoscalingPolicy, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + AutoscalingPolicy policy = new AutoscalingPolicy(); + // Make the request + AutoscalingPolicy response = await autoscalingPolicyServiceClient.UpdateAutoscalingPolicyAsync(policy); + // End snippet + } + /// Snippet for GetAutoscalingPolicy public void GetAutoscalingPolicyRequestObject() { @@ -126,6 +240,60 @@ public async Task GetAutoscalingPolicyRequestObjectAsync() // End snippet } + /// Snippet for GetAutoscalingPolicy + public void GetAutoscalingPolicy() + { + // Snippet: GetAutoscalingPolicy(string, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]"; + // Make the request + AutoscalingPolicy response = autoscalingPolicyServiceClient.GetAutoscalingPolicy(name); + // End snippet + } + + /// Snippet for GetAutoscalingPolicyAsync + public async Task GetAutoscalingPolicyAsync() + { + // Snippet: GetAutoscalingPolicyAsync(string, CallSettings) + // Additional: GetAutoscalingPolicyAsync(string, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]"; + // Make the request + AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(name); + // End snippet + } + + /// Snippet for GetAutoscalingPolicy + public void GetAutoscalingPolicyResourceNames() + { + // Snippet: GetAutoscalingPolicy(AutoscalingPolicyName, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + // Make the request + AutoscalingPolicy response = autoscalingPolicyServiceClient.GetAutoscalingPolicy(name); + // End snippet + } + + /// Snippet for GetAutoscalingPolicyAsync + public async Task GetAutoscalingPolicyResourceNamesAsync() + { + // Snippet: GetAutoscalingPolicyAsync(AutoscalingPolicyName, CallSettings) + // Additional: GetAutoscalingPolicyAsync(AutoscalingPolicyName, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + // Make the request + AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(name); + // End snippet + } + /// Snippet for ListAutoscalingPolicies public void ListAutoscalingPoliciesRequestObject() { @@ -222,6 +390,276 @@ await response.AsRawResponses().ForEachAsync((ListAutoscalingPoliciesResponse pa // End snippet } + /// Snippet for ListAutoscalingPolicies + public void ListAutoscalingPolicies() + { + // Snippet: ListAutoscalingPolicies(string, string, int?, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + string parent = "projects/[PROJECT]/locations/[LOCATION]"; + // Make the request + PagedEnumerable response = autoscalingPolicyServiceClient.ListAutoscalingPolicies(parent); + + // Iterate over all response items, lazily performing RPCs as required + foreach (AutoscalingPolicy 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 (ListAutoscalingPoliciesResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (AutoscalingPolicy 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 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 (AutoscalingPolicy 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 + } + + /// Snippet for ListAutoscalingPolicies + public async Task ListAutoscalingPoliciesAsync() + { + // Snippet: ListAutoscalingPoliciesAsync(string, string, int?, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + string parent = "projects/[PROJECT]/locations/[LOCATION]"; + // Make the request + PagedAsyncEnumerable response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(parent); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((AutoscalingPolicy 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((ListAutoscalingPoliciesResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (AutoscalingPolicy 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 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 (AutoscalingPolicy 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 + } + + /// Snippet for ListAutoscalingPolicies + public void ListAutoscalingPoliciesResourceNames1() + { + // Snippet: ListAutoscalingPolicies(LocationName, string, int?, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); + // Make the request + PagedEnumerable response = autoscalingPolicyServiceClient.ListAutoscalingPolicies(parent); + + // Iterate over all response items, lazily performing RPCs as required + foreach (AutoscalingPolicy 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 (ListAutoscalingPoliciesResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (AutoscalingPolicy 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 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 (AutoscalingPolicy 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 + } + + /// Snippet for ListAutoscalingPolicies + public async Task ListAutoscalingPoliciesResourceNames1Async() + { + // Snippet: ListAutoscalingPoliciesAsync(LocationName, string, int?, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); + // Make the request + PagedAsyncEnumerable response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(parent); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((AutoscalingPolicy 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((ListAutoscalingPoliciesResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (AutoscalingPolicy 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 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 (AutoscalingPolicy 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 + } + + /// Snippet for ListAutoscalingPolicies + public void ListAutoscalingPoliciesResourceNames2() + { + // Snippet: ListAutoscalingPolicies(RegionName, string, int?, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]"); + // Make the request + PagedEnumerable response = autoscalingPolicyServiceClient.ListAutoscalingPolicies(parent); + + // Iterate over all response items, lazily performing RPCs as required + foreach (AutoscalingPolicy 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 (ListAutoscalingPoliciesResponse page in response.AsRawResponses()) + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (AutoscalingPolicy 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 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 (AutoscalingPolicy 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 + } + + /// Snippet for ListAutoscalingPolicies + public async Task ListAutoscalingPoliciesResourceNames2Async() + { + // Snippet: ListAutoscalingPoliciesAsync(RegionName, string, int?, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]"); + // Make the request + PagedAsyncEnumerable response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(parent); + + // Iterate over all response items, lazily performing RPCs as required + await response.ForEachAsync((AutoscalingPolicy 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((ListAutoscalingPoliciesResponse page) => + { + // Do something with each page of items + Console.WriteLine("A page of results:"); + foreach (AutoscalingPolicy 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 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 (AutoscalingPolicy 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 + } + /// Snippet for DeleteAutoscalingPolicy public void DeleteAutoscalingPolicyRequestObject() { @@ -254,5 +692,59 @@ public async Task DeleteAutoscalingPolicyRequestObjectAsync() await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(request); // End snippet } + + /// Snippet for DeleteAutoscalingPolicy + public void DeleteAutoscalingPolicy() + { + // Snippet: DeleteAutoscalingPolicy(string, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]"; + // Make the request + autoscalingPolicyServiceClient.DeleteAutoscalingPolicy(name); + // End snippet + } + + /// Snippet for DeleteAutoscalingPolicyAsync + public async Task DeleteAutoscalingPolicyAsync() + { + // Snippet: DeleteAutoscalingPolicyAsync(string, CallSettings) + // Additional: DeleteAutoscalingPolicyAsync(string, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]"; + // Make the request + await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(name); + // End snippet + } + + /// Snippet for DeleteAutoscalingPolicy + public void DeleteAutoscalingPolicyResourceNames() + { + // Snippet: DeleteAutoscalingPolicy(AutoscalingPolicyName, CallSettings) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); + // Initialize request argument(s) + AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + // Make the request + autoscalingPolicyServiceClient.DeleteAutoscalingPolicy(name); + // End snippet + } + + /// Snippet for DeleteAutoscalingPolicyAsync + public async Task DeleteAutoscalingPolicyResourceNamesAsync() + { + // Snippet: DeleteAutoscalingPolicyAsync(AutoscalingPolicyName, CallSettings) + // Additional: DeleteAutoscalingPolicyAsync(AutoscalingPolicyName, CancellationToken) + // Create client + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); + // Initialize request argument(s) + AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + // Make the request + await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(name); + // End snippet + } } } diff --git a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Tests/AutoscalingPolicyServiceClientTest.g.cs b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Tests/AutoscalingPolicyServiceClientTest.g.cs index af0eff027e1f..4bec53185685 100644 --- a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Tests/AutoscalingPolicyServiceClientTest.g.cs +++ b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1.Tests/AutoscalingPolicyServiceClientTest.g.cs @@ -78,6 +78,156 @@ public void CreateAutoscalingPolicyRequestObject() mockGrpcClient.VerifyAll(); } + [xunit::FactAttribute] + public void CreateAutoscalingPolicy() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.CreateAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy response = client.CreateAutoscalingPolicy(request.Parent, request.Policy); + xunit::Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task CreateAutoscalingPolicyAsync() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.CreateAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy responseCallSettings = await client.CreateAutoscalingPolicyAsync(request.Parent, request.Policy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + AutoscalingPolicy responseCancellationToken = await client.CreateAutoscalingPolicyAsync(request.Parent, request.Policy, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public void CreateAutoscalingPolicyResourceNames1() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.CreateAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy response = client.CreateAutoscalingPolicy(request.ParentAsLocationName, request.Policy); + xunit::Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task CreateAutoscalingPolicyResourceNames1Async() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.CreateAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy responseCallSettings = await client.CreateAutoscalingPolicyAsync(request.ParentAsLocationName, request.Policy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + AutoscalingPolicy responseCancellationToken = await client.CreateAutoscalingPolicyAsync(request.ParentAsLocationName, request.Policy, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public void CreateAutoscalingPolicyResourceNames2() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.CreateAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy response = client.CreateAutoscalingPolicy(request.ParentAsRegionName, request.Policy); + xunit::Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task CreateAutoscalingPolicyResourceNames2Async() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gagr::LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.CreateAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy responseCallSettings = await client.CreateAutoscalingPolicyAsync(request.ParentAsRegionName, request.Policy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + AutoscalingPolicy responseCancellationToken = await client.CreateAutoscalingPolicyAsync(request.ParentAsRegionName, request.Policy, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); + mockGrpcClient.VerifyAll(); + } + [xunit::FactAttribute] public void UpdateAutoscalingPolicyRequestObject() { @@ -126,6 +276,54 @@ public void UpdateAutoscalingPolicyRequestObject() mockGrpcClient.VerifyAll(); } + [xunit::FactAttribute] + public void UpdateAutoscalingPolicy() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + UpdateAutoscalingPolicyRequest request = new UpdateAutoscalingPolicyRequest + { + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.UpdateAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy response = client.UpdateAutoscalingPolicy(request.Policy); + xunit::Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task UpdateAutoscalingPolicyAsync() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + UpdateAutoscalingPolicyRequest request = new UpdateAutoscalingPolicyRequest + { + Policy = new AutoscalingPolicy(), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.UpdateAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy responseCallSettings = await client.UpdateAutoscalingPolicyAsync(request.Policy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + AutoscalingPolicy responseCancellationToken = await client.UpdateAutoscalingPolicyAsync(request.Policy, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); + mockGrpcClient.VerifyAll(); + } + [xunit::FactAttribute] public void GetAutoscalingPolicyRequestObject() { @@ -174,6 +372,102 @@ public void GetAutoscalingPolicyRequestObject() mockGrpcClient.VerifyAll(); } + [xunit::FactAttribute] + public void GetAutoscalingPolicy() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + GetAutoscalingPolicyRequest request = new GetAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.GetAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy response = client.GetAutoscalingPolicy(request.Name); + xunit::Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task GetAutoscalingPolicyAsync() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + GetAutoscalingPolicyRequest request = new GetAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.GetAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy responseCallSettings = await client.GetAutoscalingPolicyAsync(request.Name, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + AutoscalingPolicy responseCancellationToken = await client.GetAutoscalingPolicyAsync(request.Name, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public void GetAutoscalingPolicyResourceNames() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + GetAutoscalingPolicyRequest request = new GetAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.GetAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy response = client.GetAutoscalingPolicy(request.AutoscalingPolicyName); + xunit::Assert.Same(expectedResponse, response); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task GetAutoscalingPolicyResourceNamesAsync() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + GetAutoscalingPolicyRequest request = new GetAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + AutoscalingPolicy expectedResponse = new AutoscalingPolicy + { + Id = "id74b70bb8", + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + BasicAlgorithm = new BasicAutoscalingAlgorithm(), + WorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + SecondaryWorkerConfig = new InstanceGroupAutoscalingPolicyConfig(), + }; + mockGrpcClient.Setup(x => x.GetAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + AutoscalingPolicy responseCallSettings = await client.GetAutoscalingPolicyAsync(request.AutoscalingPolicyName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + xunit::Assert.Same(expectedResponse, responseCallSettings); + AutoscalingPolicy responseCancellationToken = await client.GetAutoscalingPolicyAsync(request.AutoscalingPolicyName, st::CancellationToken.None); + xunit::Assert.Same(expectedResponse, responseCancellationToken); + mockGrpcClient.VerifyAll(); + } + [xunit::FactAttribute] public void DeleteAutoscalingPolicyRequestObject() { @@ -204,5 +498,67 @@ public void DeleteAutoscalingPolicyRequestObject() await client.DeleteAutoscalingPolicyAsync(request, st::CancellationToken.None); mockGrpcClient.VerifyAll(); } + + [xunit::FactAttribute] + public void DeleteAutoscalingPolicy() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + wkt::Empty expectedResponse = new wkt::Empty { }; + mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + client.DeleteAutoscalingPolicy(request.Name); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task DeleteAutoscalingPolicyAsync() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + wkt::Empty expectedResponse = new wkt::Empty { }; + mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + await client.DeleteAutoscalingPolicyAsync(request.Name, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + await client.DeleteAutoscalingPolicyAsync(request.Name, st::CancellationToken.None); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public void DeleteAutoscalingPolicyResourceNames() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + wkt::Empty expectedResponse = new wkt::Empty { }; + mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + client.DeleteAutoscalingPolicy(request.AutoscalingPolicyName); + mockGrpcClient.VerifyAll(); + } + + [xunit::FactAttribute] + public async stt::Task DeleteAutoscalingPolicyResourceNamesAsync() + { + moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest + { + AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), + }; + wkt::Empty expectedResponse = new wkt::Empty { }; + mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); + await client.DeleteAutoscalingPolicyAsync(request.AutoscalingPolicyName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + await client.DeleteAutoscalingPolicyAsync(request.AutoscalingPolicyName, st::CancellationToken.None); + mockGrpcClient.VerifyAll(); + } } } diff --git a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicies.cs b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicies.cs index cd7b9121b44d..98f1463d4e21 100644 --- a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicies.cs +++ b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicies.cs @@ -26,10 +26,10 @@ static AutoscalingPoliciesReflection() { string.Concat( "CjNnb29nbGUvY2xvdWQvZGF0YXByb2MvdjEvYXV0b3NjYWxpbmdfcG9saWNp", "ZXMucHJvdG8SGGdvb2dsZS5jbG91ZC5kYXRhcHJvYy52MRocZ29vZ2xlL2Fw", - "aS9hbm5vdGF0aW9ucy5wcm90bxofZ29vZ2xlL2FwaS9maWVsZF9iZWhhdmlv", - "ci5wcm90bxoZZ29vZ2xlL2FwaS9yZXNvdXJjZS5wcm90bxoeZ29vZ2xlL3By", - "b3RvYnVmL2R1cmF0aW9uLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHku", - "cHJvdG8aF2dvb2dsZS9hcGkvY2xpZW50LnByb3RvIqgEChFBdXRvc2NhbGlu", + "aS9hbm5vdGF0aW9ucy5wcm90bxoXZ29vZ2xlL2FwaS9jbGllbnQucHJvdG8a", + "H2dvb2dsZS9hcGkvZmllbGRfYmVoYXZpb3IucHJvdG8aGWdvb2dsZS9hcGkv", + "cmVzb3VyY2UucHJvdG8aHmdvb2dsZS9wcm90b2J1Zi9kdXJhdGlvbi5wcm90", + "bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvIqgEChFBdXRvc2NhbGlu", "Z1BvbGljeRIKCgJpZBgBIAEoCRIRCgRuYW1lGAIgASgJQgPgQQMSUwoPYmFz", "aWNfYWxnb3JpdGhtGAMgASgLMjMuZ29vZ2xlLmNsb3VkLmRhdGFwcm9jLnYx", "LkJhc2ljQXV0b3NjYWxpbmdBbGdvcml0aG1CA+BBAkgAEloKDXdvcmtlcl9j", @@ -70,45 +70,46 @@ static AutoscalingPoliciesReflection() { "YWdlX3Rva2VuGAMgASgJQgPgQQEigwEKH0x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RoL2Nsb3VkLXBsYXRmb3JtQsQBChxjb20u", + "Z29vZ2xlLmNsb3VkLmRhdGFwcm9jLnYxQhhBdXRvc2NhbGluZ1BvbGljaWVz", + "UHJvdG9QAVpAZ29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBp", + "cy9jbG91ZC9kYXRhcHJvYy92MTtkYXRhcHJvY+pBRQoeZGF0YXByb2MuZ29v", + "Z2xlYXBpcy5jb20vUmVnaW9uEiNwcm9qZWN0cy97cHJvamVjdH0vcmVnaW9u", + "cy97cmVnaW9ufWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, }, + new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Dataproc.V1.AutoscalingPolicy), global::Google.Cloud.Dataproc.V1.AutoscalingPolicy.Parser, new[]{ "Id", "Name", "BasicAlgorithm", "WorkerConfig", "SecondaryWorkerConfig" }, new[]{ "Algorithm" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Dataproc.V1.BasicAutoscalingAlgorithm), global::Google.Cloud.Dataproc.V1.BasicAutoscalingAlgorithm.Parser, new[]{ "YarnConfig", "CooldownPeriod" }, null, null, null, null), diff --git a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicyServiceClient.g.cs b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicyServiceClient.g.cs index ca42a0cc52d7..010126475d7e 100644 --- a/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicyServiceClient.g.cs +++ b/apis/Google.Cloud.Dataproc.V1/Google.Cloud.Dataproc.V1/AutoscalingPolicyServiceClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; using gaxgrpccore = Google.Api.Gax.Grpc.GrpcCore; +using gagr = Google.Api.Gax.ResourceNames; using proto = Google.Protobuf; using wkt = Google.Protobuf.WellKnownTypes; using grpccore = Grpc.Core; @@ -299,6 +300,237 @@ public virtual AutoscalingPolicy CreateAutoscalingPolicy(CreateAutoscalingPolicy public virtual stt::Task CreateAutoscalingPolicyAsync(CreateAutoscalingPolicyRequest request, st::CancellationToken cancellationToken) => CreateAutoscalingPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual AutoscalingPolicy CreateAutoscalingPolicy(string parent, AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + CreateAutoscalingPolicy(new CreateAutoscalingPolicyRequest + { + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + Policy = policy, + }, callSettings); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task CreateAutoscalingPolicyAsync(string parent, AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + CreateAutoscalingPolicyAsync(new CreateAutoscalingPolicyRequest + { + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + Policy = policy, + }, callSettings); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task CreateAutoscalingPolicyAsync(string parent, AutoscalingPolicy policy, st::CancellationToken cancellationToken) => + CreateAutoscalingPolicyAsync(parent, policy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual AutoscalingPolicy CreateAutoscalingPolicy(gagr::LocationName parent, AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + CreateAutoscalingPolicy(new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + Policy = policy, + }, callSettings); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task CreateAutoscalingPolicyAsync(gagr::LocationName parent, AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + CreateAutoscalingPolicyAsync(new CreateAutoscalingPolicyRequest + { + ParentAsLocationName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + Policy = policy, + }, callSettings); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task CreateAutoscalingPolicyAsync(gagr::LocationName parent, AutoscalingPolicy policy, st::CancellationToken cancellationToken) => + CreateAutoscalingPolicyAsync(parent, policy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual AutoscalingPolicy CreateAutoscalingPolicy(RegionName parent, AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + CreateAutoscalingPolicy(new CreateAutoscalingPolicyRequest + { + ParentAsRegionName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + Policy = policy, + }, callSettings); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task CreateAutoscalingPolicyAsync(RegionName parent, AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + CreateAutoscalingPolicyAsync(new CreateAutoscalingPolicyRequest + { + ParentAsRegionName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + Policy = policy, + }, callSettings); + + /// + /// Creates new autoscaling policy. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.create`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.create`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The autoscaling policy to create. + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task CreateAutoscalingPolicyAsync(RegionName parent, AutoscalingPolicy policy, st::CancellationToken cancellationToken) => + CreateAutoscalingPolicyAsync(parent, policy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// /// Updates (replaces) autoscaling policy. /// @@ -335,6 +567,54 @@ public virtual AutoscalingPolicy UpdateAutoscalingPolicy(UpdateAutoscalingPolicy public virtual stt::Task UpdateAutoscalingPolicyAsync(UpdateAutoscalingPolicyRequest request, st::CancellationToken cancellationToken) => UpdateAutoscalingPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// + /// Updates (replaces) autoscaling policy. + /// + /// Disabled check for update_mask, because all updates will be full + /// replacements. + /// + /// + /// Required. The updated autoscaling policy. + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual AutoscalingPolicy UpdateAutoscalingPolicy(AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + UpdateAutoscalingPolicy(new UpdateAutoscalingPolicyRequest + { + Policy = gax::GaxPreconditions.CheckNotNull(policy, nameof(policy)), + }, callSettings); + + /// + /// Updates (replaces) autoscaling policy. + /// + /// Disabled check for update_mask, because all updates will be full + /// replacements. + /// + /// + /// Required. The updated autoscaling policy. + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task UpdateAutoscalingPolicyAsync(AutoscalingPolicy policy, gaxgrpc::CallSettings callSettings = null) => + UpdateAutoscalingPolicyAsync(new UpdateAutoscalingPolicyRequest + { + Policy = gax::GaxPreconditions.CheckNotNull(policy, nameof(policy)), + }, callSettings); + + /// + /// Updates (replaces) autoscaling policy. + /// + /// Disabled check for update_mask, because all updates will be full + /// replacements. + /// + /// + /// Required. The updated autoscaling policy. + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task UpdateAutoscalingPolicyAsync(AutoscalingPolicy policy, st::CancellationToken cancellationToken) => + UpdateAutoscalingPolicyAsync(policy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// /// Retrieves autoscaling policy. /// @@ -362,6 +642,138 @@ public virtual AutoscalingPolicy GetAutoscalingPolicy(GetAutoscalingPolicyReques public virtual stt::Task GetAutoscalingPolicyAsync(GetAutoscalingPolicyRequest request, st::CancellationToken cancellationToken) => GetAutoscalingPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// + /// Retrieves autoscaling policy. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual AutoscalingPolicy GetAutoscalingPolicy(string name, gaxgrpc::CallSettings callSettings = null) => + GetAutoscalingPolicy(new GetAutoscalingPolicyRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, callSettings); + + /// + /// Retrieves autoscaling policy. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task GetAutoscalingPolicyAsync(string name, gaxgrpc::CallSettings callSettings = null) => + GetAutoscalingPolicyAsync(new GetAutoscalingPolicyRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, callSettings); + + /// + /// Retrieves autoscaling policy. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task GetAutoscalingPolicyAsync(string name, st::CancellationToken cancellationToken) => + GetAutoscalingPolicyAsync(name, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Retrieves autoscaling policy. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual AutoscalingPolicy GetAutoscalingPolicy(AutoscalingPolicyName name, gaxgrpc::CallSettings callSettings = null) => + GetAutoscalingPolicy(new GetAutoscalingPolicyRequest + { + AutoscalingPolicyName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, callSettings); + + /// + /// Retrieves autoscaling policy. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task GetAutoscalingPolicyAsync(AutoscalingPolicyName name, gaxgrpc::CallSettings callSettings = null) => + GetAutoscalingPolicyAsync(new GetAutoscalingPolicyRequest + { + AutoscalingPolicyName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, callSettings); + + /// + /// Retrieves autoscaling policy. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.get`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task GetAutoscalingPolicyAsync(AutoscalingPolicyName name, st::CancellationToken cancellationToken) => + GetAutoscalingPolicyAsync(name, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// /// Lists autoscaling policies in the project. /// @@ -380,6 +792,204 @@ public virtual AutoscalingPolicy GetAutoscalingPolicy(GetAutoscalingPolicyReques public virtual gax::PagedAsyncEnumerable ListAutoscalingPoliciesAsync(ListAutoscalingPoliciesRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); + /// + /// Lists autoscaling policies in the project. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.list`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.list`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The token returned from the previous request. A value of null or an empty string retrieves the first + /// page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. A value of + /// null or 0 uses a server-defined page size. + /// + /// If not null, applies overrides to this RPC call. + /// A pageable sequence of resources. + public virtual gax::PagedEnumerable ListAutoscalingPolicies(string parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => + ListAutoscalingPolicies(new ListAutoscalingPoliciesRequest + { + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, callSettings); + + /// + /// Lists autoscaling policies in the project. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.list`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.list`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The token returned from the previous request. A value of null or an empty string retrieves the first + /// page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. A value of + /// null or 0 uses a server-defined page size. + /// + /// If not null, applies overrides to this RPC call. + /// A pageable asynchronous sequence of resources. + public virtual gax::PagedAsyncEnumerable ListAutoscalingPoliciesAsync(string parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => + ListAutoscalingPoliciesAsync(new ListAutoscalingPoliciesRequest + { + Parent = gax::GaxPreconditions.CheckNotNullOrEmpty(parent, nameof(parent)), + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, callSettings); + + /// + /// Lists autoscaling policies in the project. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.list`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.list`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The token returned from the previous request. A value of null or an empty string retrieves the first + /// page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. A value of + /// null or 0 uses a server-defined page size. + /// + /// If not null, applies overrides to this RPC call. + /// A pageable sequence of resources. + public virtual gax::PagedEnumerable ListAutoscalingPolicies(gagr::LocationName parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => + ListAutoscalingPolicies(new ListAutoscalingPoliciesRequest + { + ParentAsLocationName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, callSettings); + + /// + /// Lists autoscaling policies in the project. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.list`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.list`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The token returned from the previous request. A value of null or an empty string retrieves the first + /// page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. A value of + /// null or 0 uses a server-defined page size. + /// + /// If not null, applies overrides to this RPC call. + /// A pageable asynchronous sequence of resources. + public virtual gax::PagedAsyncEnumerable ListAutoscalingPoliciesAsync(gagr::LocationName parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => + ListAutoscalingPoliciesAsync(new ListAutoscalingPoliciesRequest + { + ParentAsLocationName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, callSettings); + + /// + /// Lists autoscaling policies in the project. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.list`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.list`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The token returned from the previous request. A value of null or an empty string retrieves the first + /// page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. A value of + /// null or 0 uses a server-defined page size. + /// + /// If not null, applies overrides to this RPC call. + /// A pageable sequence of resources. + public virtual gax::PagedEnumerable ListAutoscalingPolicies(RegionName parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => + ListAutoscalingPolicies(new ListAutoscalingPoliciesRequest + { + ParentAsRegionName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, callSettings); + + /// + /// Lists autoscaling policies in the project. + /// + /// + /// Required. The "resource name" of the region or location, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.list`, the resource name + /// of the region has the following format: + /// `projects/{project_id}/regions/{region}` + /// + /// * For `projects.locations.autoscalingPolicies.list`, the resource name + /// of the location has the following format: + /// `projects/{project_id}/locations/{location}` + /// + /// + /// The token returned from the previous request. A value of null or an empty string retrieves the first + /// page. + /// + /// + /// The size of page to request. The response will not be larger than this, but may be smaller. A value of + /// null or 0 uses a server-defined page size. + /// + /// If not null, applies overrides to this RPC call. + /// A pageable asynchronous sequence of resources. + public virtual gax::PagedAsyncEnumerable ListAutoscalingPoliciesAsync(RegionName parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => + ListAutoscalingPoliciesAsync(new ListAutoscalingPoliciesRequest + { + ParentAsRegionName = gax::GaxPreconditions.CheckNotNull(parent, nameof(parent)), + PageToken = pageToken ?? "", + PageSize = pageSize ?? 0, + }, callSettings); + /// /// Deletes an autoscaling policy. It is an error to delete an autoscaling /// policy that is in use by one or more clusters. @@ -409,6 +1019,144 @@ public virtual void DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest reque /// A Task containing the RPC response. public virtual stt::Task DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest request, st::CancellationToken cancellationToken) => DeleteAutoscalingPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes an autoscaling policy. It is an error to delete an autoscaling + /// policy that is in use by one or more clusters. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual void DeleteAutoscalingPolicy(string name, gaxgrpc::CallSettings callSettings = null) => + DeleteAutoscalingPolicy(new DeleteAutoscalingPolicyRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, callSettings); + + /// + /// Deletes an autoscaling policy. It is an error to delete an autoscaling + /// policy that is in use by one or more clusters. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task DeleteAutoscalingPolicyAsync(string name, gaxgrpc::CallSettings callSettings = null) => + DeleteAutoscalingPolicyAsync(new DeleteAutoscalingPolicyRequest + { + Name = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)), + }, callSettings); + + /// + /// Deletes an autoscaling policy. It is an error to delete an autoscaling + /// policy that is in use by one or more clusters. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task DeleteAutoscalingPolicyAsync(string name, st::CancellationToken cancellationToken) => + DeleteAutoscalingPolicyAsync(name, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + + /// + /// Deletes an autoscaling policy. It is an error to delete an autoscaling + /// policy that is in use by one or more clusters. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// The RPC response. + public virtual void DeleteAutoscalingPolicy(AutoscalingPolicyName name, gaxgrpc::CallSettings callSettings = null) => + DeleteAutoscalingPolicy(new DeleteAutoscalingPolicyRequest + { + AutoscalingPolicyName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, callSettings); + + /// + /// Deletes an autoscaling policy. It is an error to delete an autoscaling + /// policy that is in use by one or more clusters. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// If not null, applies overrides to this RPC call. + /// A Task containing the RPC response. + public virtual stt::Task DeleteAutoscalingPolicyAsync(AutoscalingPolicyName name, gaxgrpc::CallSettings callSettings = null) => + DeleteAutoscalingPolicyAsync(new DeleteAutoscalingPolicyRequest + { + AutoscalingPolicyName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)), + }, callSettings); + + /// + /// Deletes an autoscaling policy. It is an error to delete an autoscaling + /// policy that is in use by one or more clusters. + /// + /// + /// Required. The "resource name" of the autoscaling policy, as described + /// in https://cloud.google.com/apis/design/resource_names. + /// + /// * For `projects.regions.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + /// + /// * For `projects.locations.autoscalingPolicies.delete`, the resource name + /// of the policy has the following format: + /// `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + /// + /// A to use for this RPC. + /// A Task containing the RPC response. + public virtual stt::Task DeleteAutoscalingPolicyAsync(AutoscalingPolicyName name, st::CancellationToken cancellationToken) => + DeleteAutoscalingPolicyAsync(name, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } /// AutoscalingPolicyService client wrapper implementation, for convenient use.